I can not get queues.

Pointed in .env :

 QUEUE_DRIVER=database 

Created a table: jobs

In the code I write:

 dispatch((new \App\Jobs\SendEmail($userMail, $data))->onQueue('emails')); 

In the console, run the command php artisan queue:listen or php artisan queue:work

But nothing happens. Only added a new entry to the database and that's it ...

It's strange that the commands in the console just hang without displaying anything on the screen.

    1 answer 1

    Specify the type of queue when calling the worker, in your example in writing tasks to the emails queue.

    Call the worker as follows:

     php artisan queue:work --queue=emails 

    And if nothing happens with the command above - check that it is written to the queue table.