0
votes

I want to send mail using queue. Laravel queue works well in local server with the command "php artisan queue:listen". How to process the queue in online server

3
Can you set up a cron job on your server to run the queue command?haakym
I already set a cron job in my server. But it can't workSundara Pandiyan
Please provide details on the cron job and why it doesn't work. What happens when you try to run it?haakym

3 Answers

1
votes

you have to install supervisor in you server.
See here for installation guide

0
votes

You could also use the task scheduller but it still requires to setup a cron job

0
votes

You can schedule you queue command in kernel file as below,

 protected function schedule(Schedule $schedule)
    {
        $schedule->command('queue:work --tries=3')->cron('* * * * * *');
    }

and set laravel cron on server as below,

* * * * * php /path-to-your-project/artisan schedule:run >> /dev/null 2>&1

So this main cron will run mail:queue every minute.