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 SendWelcomeEmailAll lessons in this course
- Queue Concepts and Drivers
- Creating and Dispatching Jobs
- Job Retries, Delays, and Chaining
- Monitoring Queues with Laravel Horizon