I am facing a serious problem in Laravel Queue system please help me to fix this issue.
Once I queue my mail by using
$mailer = Mail::to($email_to)->queue(new ContactGeneral($data));
it stores into the database and runs this command from terminal php artisan queue:listen it works fine once I close my terminal it does not listen to my queue.
For that, I set up a scheduled in kernem.php file like that which run in every minute
protected function schedule(Schedule $schedule){
$schedule->command('queue:listen')->everyMinute();
}
set this line in a cronjob and work fine
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
Problem is as runs every minute run every minute it not kill the previous process and run another process in next minute it slowdown my server
Please can you let me know what is the best way to implement this
Thanks in advance