Eloquent will happily hide an N+1 query until it hits production. Strict model mode turns those silent mistakes into loud exceptions during development.
Tips
A handful of Artisan optimization commands shave real milliseconds off every request in production. Here is what each one does and when to run it.
Factory states, relationships, and sequences let you express exactly the test data a scenario needs in a single readable line.
Named rate limiters and the RateLimiter facade let you throttle routes and any arbitrary action with per-user, per-plan, or dynamic limits.
Two small Laravel features, the tap() helper and higher-order collection messages, quietly remove a surprising amount of boilerplate from everyday code.
Cast Eloquent attributes to backed PHP enums to replace magic strings with real types, and give your enums behavior with helper methods.
Query scopes let you name and reuse common Eloquent constraints so your controllers stay readable and your query logic lives in one place.
Eight practical Laravel patterns that make your code read more like intent and less like implementation — from fluent helpers to conditional chains.
Caching is the fastest performance win in Laravel, but only if you do it right. These tips cover remember, cache stampedes, tagging, and atomic locks.
Route model binding does more than inject a model. Custom keys, scoped bindings, soft-delete handling, and enums all hide behind this everyday feature.
Carbon ships with every Laravel app and handles dates beautifully once you know its tricks. Here are practical tips for comparisons, timezones, and testing time.
Form Requests do more than validate. These tips cover authorization, data prep, after hooks, and returning clean validated data your controllers will love.