Sundara Pandiyan
Sundara Pandiyan

Reputation: 1

How to process laravel queue in online server

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

Answers (3)

Ranjan Adhikari
Ranjan Adhikari

Reputation: 261

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

Upvotes: 2

coDe murDerer
coDe murDerer

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

kejsu
kejsu

Reputation: 384

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

Upvotes: 0

Related Questions