Deployment
Pre-requisite
PHP >= 8.2
Ctype PHP Extension
cURL PHP Extension
DOM PHP Extension
Fileinfo PHP Extension
Filter PHP Extension
Hash PHP Extension
Mbstring PHP Extension
OpenSSL PHP Extension
PCRE PHP Extension
PDO PHP Extension
Session PHP Extension
Tokenizer PHP Extension
XML PHP Extension
Intl PHP Extension
Server Configuration
Nginx
Please ensure, like the configuration below, your web server directs all requests to your application's public/index.php
file. You should never attempt to move the index.php
file to your project's root, as serving the application from the project root will expose many sensitive configuration files to the public Internet:
Laravel Reverb (Real-time Notification/Broadcast)
Cron Job
Create a cron job in you server machine and add the below cron job script.
Supervisor Configuration
In production, you need a way to keep your queue:work
processes running. A queue:work
process may stop running for a variety of reasons, such as an exceeded worker timeout or the execution of the queue:restart
command.
Installing Supervisor
Supervisor is a process monitor for the Linux operating system, and will automatically restart your queue:work
processes if they fail. To install Supervisor on Ubuntu, you may use the following command:
Configuring Supervisor
Supervisor configuration files are typically stored in the /etc/supervisor/conf.d
directory. Within this directory, you may create any number of configuration files that instruct supervisor how your processes should be monitored. For example, let's create a laravel-worker.conf
file that starts and monitors queue:work
processes:
Starting Supervisor
Once the configuration file has been created, you may update the Supervisor configuration and start the processes using the following commands:
For more information on Supervisor, consult the Supervisor documentation.