Laravel theorytheory 0/50 · 0%
Async · medium

21. Queues & Jobs

Deferring slow work.

Queues allow you to defer time-consuming tasks, like sending emails, to be processed in the background by a worker process (php artisan queue:work). Jobs are classes implementing ShouldQueue, dispatched with MyJob::dispatch($data), and can be delayed, chained, or batched. Failed jobs are stored for inspection and can be retried with php artisan queue:retry.

Check your understanding

  1. 1. Which command starts processing queued jobs?

  2. 2. How do you dispatch a job to run after 10 minutes?