guys, I have a function I wrote it I put send mail in a job queue how can I configure it on cpanel and keep the php artisan queue:work always run in the background on cpanel?
unless this is your server, you will be unlikely to be able to install supervisor
The only real solution is to run the queue from the scheduler every minute with the option to quit when empty and then without overlapping on the schedule
This will start the queue worker which will service the queue and then stop. At the next minute it will start again, service the queue and stop
app/Console/Kernel.php
protected function schedule(Schedule $schedule)
{
$schedule->command('queue:work --stop-when-empty')->everyMinute()->withoutOverlapping();
}
and then setup a cron job in cpanel to run the scheduler once per minute