php artisan make:model does more than scaffold a bare class. These flags save you the follow-up commands.
#Tips
Articles
Stop hardcoding foreign key column names in every query. whereBelongsTo() reads the relationship definition for you.
N+1 queries usually get discovered in production. This one setting makes Eloquent throw the moment they happen locally instead.
Calling five APIs one after another adds up their latencies. Http::pool() fires them concurrently and waits once.
Stop hand-rolling LIKE clauses with percent signs. These built-in query builder methods read cleaner and avoid dialect quirks.
Eager loading the parent relation still triggers a query per child model. chaperone() closes that gap for free.
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.
Blade components are more powerful than most developers realize. These tricks cover attribute bags, named slots, props, and conditional rendering you will use daily.
Most foreach loops in a Laravel app can be replaced with a single, more readable collection method. Here are seven that will clean up your code today.
Middleware in Laravel goes well beyond authentication guards. These five techniques cover terminable middleware, priority ordering, route-level parameters, and more.