1. Create table for queue and also failed-table too. Queue table is for saving list of some jobs (emails that will be sent) and failed-table is for saving failed list of our emails. For creating those tables, we can use these commands :
php artisan queue:table
php artisan queue:failed-table
So we have two migration files now :Next, execute migration command:
php artisan migrate
Aaand now we have two tables in our phpmyadmin :2. Change QUEUE_DRIVER = sync to database on .env file :
3. Create new job :
php artisan make:job {your-job-file-name}
5. Actually, we can do this step in step 3, buuut... mmmm.... yaaah... it's okie to seperate it in another step... :D
So... in this step 5, let's complete our handle method :
6. Run php artisan queue:listen
This command is the starting point for our queue job to be executed by laravel.