Laravel Queue vs defer(): When to Use Each (Laravel 11, 12 & 13)

php dev.to

Laravel 11 quietly introduced one of the most practical helpers in years: defer(). It lets you run code after the HTTP response has been sent — no queue worker, no Redis, no Supervisor config. Just: defer(fn () => Metrics::recordOrder($order)); The user gets the response instantly. The closure runs after. Zero extra infrastructure. But a lot of developers are either ignoring it or misusing it. So here's the honest breakdown. The One-Line Rule defer() → "I'm okay if th

Read Full Tutorial open_in_new
arrow_back Back to Tutorials