Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Kaluna's avatar
Level 2

Laravel Reverb, and the queue...

Hello everyone.

I have a laravel app, running laravel echo. I'm hoping to create some functionality where I can set a "band" as being "on stage".

It took ages to get it to work on production, and I have a daemon running the queue, and when I add the daemon, I have left Run Worker Using queue:work checked.

When I test the functionality, nothing happens—but I ran php artisan queue:listen and now it does work.

A quick read on Google, says that queue:work is more performative than queue:listen, and I'm wanting to make sure I do everything in the right way.

So, the question I guess I am asking is—is there anything I should check to see why queue:work doesn't actually pick up the event?

0 likes
2 replies
Ben Taylor's avatar

Queue:work won't pick up on any code changes you have made, so make sure to restart the queue wherever you make changes.

LaryAI's avatar
Level 58

Certainly! It sounds like you're having issues with your Laravel queue worker not picking up jobs when using queue:work, but it works when using queue:listen. Let's go through some steps to troubleshoot and ensure everything is set up correctly.

1. Check Queue Configuration

First, ensure your queue configuration is set up correctly in config/queue.php. Make sure the default queue connection is set to the one you are using (e.g., database, redis, etc.).

'default' => env('QUEUE_CONNECTION', 'database'),

2. Supervisor Configuration

If you're using a process manager like Supervisor to manage your queue workers, ensure that your Supervisor configuration is correct. Here is an example configuration for Supervisor:

[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /path/to/your/app/artisan queue:work --sleep=3 --tries=3 --timeout=90
autostart=true
autorestart=true
user=your-username
numprocs=3
redirect_stderr=true
stdout_logfile=/path/to/your/app/worker.log

3. Horizon (Optional)

If you are using Laravel Horizon, make sure it is properly configured and running. Horizon provides a better interface and control over your queues.

4. Environment Configuration

Ensure your .env file has the correct queue connection settings:

QUEUE_CONNECTION=database

5. Check for Errors

Check your logs for any errors that might indicate why the worker is not picking up jobs. You can find the logs in storage/logs/laravel.log.

6. Restart Queue Workers

Sometimes, simply restarting your queue workers can resolve issues. If you are using Supervisor, you can restart it with:

sudo supervisorctl restart laravel-worker:*

7. Use queue:work with Options

Make sure you are using queue:work with appropriate options. For example:

php artisan queue:work --sleep=3 --tries=3 --timeout=90

Example Code

Here is an example of how you might set up a job in Laravel:

Conclusion

By following these steps, you should be able to troubleshoot why queue:work is not picking up jobs. Ensure your configuration is correct, check for any errors, and restart your queue workers if necessary. If you continue to experience issues, consider using Laravel Horizon for better queue management and monitoring.

Please or to participate in this conversation.