how to run laravel queue on server code example
Example 1: laravel retry failed jobs command
php artisan queue:retry all
Example 2: running queue on server
nohup php artisan queue:work --daemon &
nohup php artisan queue:work --daemon > /dev/null 2>&1 &
nohup php artisan queue:work --daemon > app/storage/logs/laravel.log &
Example 3: how to automatically run queue in laravel
for queues with no queue name i.e. queue name = default
php artisan queue:work
or
php artisan queue:listen
for jobs with a queue name. Let's assume i have a queue with name = sendemail
php artisan queue:listen --queue=sendemail
note:
queue:work will only work for jobs entries currently in jobs table in database and stop.
queue:listen will go on processing queues continously, both for current and new entries.
Example 4: laravel run a specific queue by name
Execute Laravel queues by queue names on coomand line interface->
'php artisan queue:work'
php artisan queue:listen --queue=sendemail
php artisan queue:listen --queue=inboxemail