LaraMonster Pro PRO

Jobs & queues

Every job explained, run or queue it, retry failed jobs and run supervised workers.

Jobs & Queues explains each job in plain words (what handle() does, when it's scheduled, where it's dispatched, its retries and timeout), lets you run or queue it, and keeps your queues moving with failed-job tools and workers LaraMonster supervises.

Jobs & Queues is part of LaraMonster Pro.

Your jobs

LaraMonster finds the classes in app/Jobs and anything implementing ShouldQueue. Pick one to see:

  • What it does, in plain words, read from its code
  • Its schedule, if routes/console.php schedules it
  • Where it's dispatched in your code
  • Its queue, connection, tries, backoff and timeout
  • The code it runs

Export guide (PDF) turns all of that into a document for your team.

Running a job

Build the job from a Form of its constructor, from PHP, or run any Artisan command. Then:

ButtonWhat happens
Run nowExecutes handle() right here and shows what happened: output, queries, exceptions.
Queue itDispatches it to its queue, with an optional delay in seconds. A worker picks it up.
new \App\Jobs\GenerateInvoicePdf(\App\Models\Invoice::find(42))

Queues and failed jobs

The Queues & workers tab shows how many jobs wait in each queue and the failed jobs, with their exception. Retry a failed job or Forget it, or use Retry all and Delete all.

Nothing ever waits? With QUEUE_CONNECTION=sync, jobs run immediately when dispatched. Use a real queue to test queued behaviour; the database queue needs nothing else:
QUEUE_CONNECTION=database
Or redis, with Redis started on the Services page.

Workers

Start a worker from the same tab: LaraMonster runs php artisan queue:work with the site's PHP version, shows it under Workers with a Stop button, and stops it when LaraMonster stops. Restart a worker after changing job code: like any queue:work, it keeps the code it started with. List queues in priority order (for example high,default) to choose what it works on first. With Activity recording on, each job a worker runs appears there as a trace.