Reputation: 1
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
Upvotes: 0
Views: 3372
Reputation: 261
you have to install supervisor
in you server.
See here for installation guide
Upvotes: 2
Reputation: 1876
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.
Upvotes: 0
Reputation: 384
You could also use the task scheduller but it still requires to setup a cron job
Upvotes: 0