This is an step-by-step guide to install Laravel Horizon into your project. This expects the project to already have an working laravel project.
-
Install redis using the service example
-
Configure the redis configuration in
.env
-
Run
ddev composer require laravel/horizon
-
Run
ddev artisan horizon:install
-
Run horizon process in DDEV Installation
-
Option A: Run using nohup
Copy the
dot.ddev/config.laravel-horizon.yaml
into your project's .ddev directory, or incorporate it into your .ddev/config.yaml. This snipped uses a post-start hook to use artisan to start the horizon process. -
Option B: Run using supervisor
Use both
dot.ddev/web-build/Dockerfile
anddot.ddev/web-build/horizon.conf
-
-
Run
ddev restart
-
Configure your horizon configuration to your liking; see horizon documentation for reference
You are set! As configured in the supervisor or nohup command the logs are written in /storage/logs/horizon.log
.
Inspired by laravel-queue-worker by @karlshea
Contributed by @bmoex