Laravel queues not working Laravel queues not working php php

Laravel queues not working


for use queue you should some work :

in .env file you should change queue_driver from sync to database,so open .env and do the follow

queue_driver=database

after it you should create queue table in your database with artisan command :

php artisan queue:tablephp artisan migrate

and for make sure that no config cached

php artisan config:clear

and finally you should run your queue with php artisan queue:listen or php artisan queue:work


I had the same trouble, if you are using laravel 5.7, use this in .env file

QUEUE_CONNECTION=database

Next, clear config cache like this

php artisan config:clear


In my case, i use custom queue name for group my jobs.

ProcessCourseInteractions::dispatch($courseProcessing)->onQueue('course_interactions');

That queue is not executed by:

php artisan queue:work

and

php artisan queue:listen

i need specify queue name (Valid for work and listen):

php artisan queue:work --queue=course_interactions