0PricingLogin
PHP Academy · Lesson

Creating and Dispatching Jobs

Generate a job class with Artisan and dispatch it from controllers.

What is a Job?

A job is a PHP class that encapsulates a single unit of queued work. Each job implements handle(), which the queue worker calls to execute the task.

Generating a Job

Use Artisan to create a job class. The --queue flag makes it queuable (default).

$ php artisan make:job SendWelcomeEmail

All lessons in this course

  1. Queue Concepts and Drivers
  2. Creating and Dispatching Jobs
  3. Job Retries, Delays, and Chaining
  4. Monitoring Queues with Laravel Horizon
← Back to PHP Academy