Before editing the code
We are going to use Swoole functionalities, implementing some example code. When you change (or edit) your code and Laravel Octane has already loaded the worker, you have to reload the worker. Manually, you can use an Octane command. If you are using Laravel Sail (so Docker), you have to run the command in the container. The command is as follows:
php artisan octane:reload --server=swoole
If you are running in a container, you have to use the sail
command:
vendor/bin/sail php artisan octane:reload --server=swoole
If you want to avoid manually reloading workers every time you edit or change your code and you want that Octane watches automatically the file changes, you have to do the following:
- Install the chokidar node package used by Octane in
watch
mode - Change the
supervisord
configuration file in order to launch Octane with the--
watch
option - Rebuild the image to reflect the changes
- Execute
Sail
again
So, first, let&...