<aside> 📌 Follow these steps to use Laravel Horizon for Job Queueing in Statamic when hosted with Forge. This guide assumes that redis is already installed via Forge.
Add horizon to the project
composer require laravel/horizon and publish its assets
php artisan horizon:install
Allow Statamic/Laravel user to authenticate for Horizon by adding their accounts email(s) to the
Make sure the environment horizon should run on is configured properly in
1when using the [[Statamic Shopify]] addon, or make sure to use a dedicated queue for that.
Add a new Daemon to run
php artisan horizon (This will make sure the
horizon command is always run and will restart it if it fails unexpectedly)
The active daemon looks like this:
php artisan horizon:terminate to the end of the deploy script. This will make sure the old Horizon workers are gracefully terminated on each deployment, and fresh Horizon workers will be started thanks to our daemon configuration
Tell [[Statamic]] to use redis as the queue connection via .env:
Configure the redis connection in
You can test by enabling Git integration with dispatch
STATAMIC_GIT_ENABLED=true STATAMIC_GIT_PUSH=true STATAMIC_GIT_DISPATCH_DELAY=10 STATAMIC_GIT_AUTOMATIC=true
Clear the config cache, log into Statamic CP, make some content changes and open the Horizon Dashboard (you'll have access as soon as you're logged in with a user that has been added to 'HorizonServiceProvider.php').
There's even a convenient link in the Statamic panel: