Laravel worker should always run on the production environment to serve the jobs that application send to. To keep the process running, we use the Supervisord to help
Add Laravel Worker configuration on Supervisord
$ sudo vim /etc/supervisor/conf.d/laravel-worker.conf
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php8.1 /home/forge/your-project/artisan queue:listen database --sleep=3 --tries=3
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=forge
numprocs=1
stdout_logfile=/home/forge/.forge/laravel-worker.log
Let supervisord know about new config.
$ sudo supervisorctl reread
laravel-worker: availableLet supervisord start worker
$ sudo supervisorctl update
laravel-worker: added process groupVerify if supervisor started worker .
sudo supervisorctl
laravel-worker:laravel-worker_00
supervisor>