Improve Laravel Queue Speed

⚠️ Note: This feature is only available in Laravel v12.41.1 and above. If you’re running an earlier version, you’ll need to upgrade before being able to apply these changes. I recently discovered our Workers seemed to be hitting the database far too frequently. After digging into the Worker class, I figured out that it was down to the restart and pause polling that happens on each loop. I knew we could override the CacheManager class to change this behavior, but that felt… funky. It wasn’t obvious to developers, and it wasn’t really documented anywhere. So — I thought I’d open a PR, and luckily for me, it was accepted! 🎉 ...

December 3, 2025

Speeding up Laravel Jobs

When going through the Laravel Queue documentation, I noticed a section around Queued Relationships and the d-low is that essentially when you’re sending a model to a Job, if your model has relationships loaded, those relationships will also get loaded into the payload of the job. This isn’t always obvious! For example, take the below Job as an example: use App\Models\User; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; class WelcomeEmailJob implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; public function __construct(public User $user) { } public function handle() { // Some sending logic here... } } Because we’re expecting a User model its seralized, including the relations. ...

April 6, 2025