Black Friday: the Laravel testing course is $149 instead of $249, through Dec 7. See the course →
logo

Being explicit when something should not queue

A simple way to clearly communicate intent

Joel Clermont
Joel Clermont
2026-05-20

From our daily Laravel tips email. Get the next one in your inbox.

Laravel provides a simple interface you can add to a listener to make sure it runs on the queue, and not within the current request. By marking your listener as implementing Illuminate\Contracts\Queue\ShouldQueue, it wires it up for you automatically.

Most of the time, queueing a listener is a sensible default. Every once in a while, though, you might need a listener to complete its work synchronously within the request.

If you just remove the ShouldQueue interface, another developer in the future might wonder if it was an oversight, or if it was intentional. You could add a comment in the listener, but one simple technique I like is to create your own empty interface called ShouldNotQueue.

Then it's clear to anyone looking at the listener that it is intentionally not queued.

Here's the entire contents of that empty interface, there's not much to it:

namespace App\Contracts;

/**
 * This particular Listener should absolutely NOT queue
 */
interface ShouldNotQueue {}

Here to help,

Joel

P.S. We're full of good ideas like this. We packaged a few popular tips in a free eBook you can download.

Want a tip like this in your inbox every weekday?

Each one takes less than 2 minutes to read. Join 4,000+ Laravel developers who already get them.

email
No spam. Only real-world advice.
Toss a coin in the jar if you found this helpful.