Calling five APIs one after another adds up their latencies. Http::pool() fires them concurrently and waits once.
Tips
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.
Laravel's once() helper memoizes a closure's return value for the current request or process — here's when to reach for it.
Laravel's Sleep facade replaces raw sleep() calls with a fluent, fully testable API — no more multi-second test suites.
Your config/database.php connections aren't fixed at boot. Here's how to pick, register, and reset connections at runtime.
Skip the old Rule::passes()/message() dance. Build reusable, testable validation logic with ValidationRule invokable classes.
Replace nested string function calls and ternaries with Str::of() chains that read top to bottom and are easy to extend.
Three Eloquent shortcuts look almost identical. Here is how firstOrCreate, updateOrCreate, and firstOrNew actually differ, and when each one bites you.
Not every event listener needs to run inline before your response returns. Implement ShouldQueue and Laravel queues the listener automatically.
Stop opening tinker just to remember a model's attributes, casts, and relationships. artisan model:show prints all of it in one command.
Bulk imports and seeders can trigger a storm of observers and listeners you never intended. withoutEvents() and saveQuietly() turn them off cleanly.