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

bmtamim's avatar

Laravel queues in shared hosting and question about queues event.

I have setup last day a command to my shared hosting which is running fine, But as My queue run forever so, Its crashed my server.

So, I want to check if the queue has jobs then queue will start and when job finished it will stop I saw there has a flag (--stop-when-empty). And I can check the job has or not from database, But if I hit every minute in database it will also not ok.

Is there any event in Laravel that when a new job added to queue I want to listen that and do my action?

Is there any solution that can help me to run queue in shared hosting like supervisor. Thanks

0 likes
1 reply
Snapey's avatar

you should be able to run the queue continuously. If you cannot, then probably get a better host.

You can run the scheduler with the --stop-when-empty from a cron job. How you do this depends on how urgent your queued jobs are.

For instance, you can create a scheduled task that runs every 5 minutes and stops when empty.

You then need to use cron of your hosting provider to run the scheduler every minute

Please or to participate in this conversation.