Laravel Horizon is a powerful dashboard and configuration system for the Laravel Queue worker. It provides a beautiful and convenient way to monitor and manage your queued jobs. Here's a step-by-step guide on how to use the Laravel Horizon dashboard for monitoring jobs, along with some additional useful links:
Make sure you have Laravel installed. If not, you can install it using Composer:
bashcomposer create-project --prefer-dist laravel/laravel your-project-name
Next, install Laravel Horizon:
bashcomposer require laravel/horizon
After installation, publish the Horizon configuration file:
bashphp artisan vendor:publish --provider="Laravel\Horizon\HorizonServiceProvider"
This will create a horizon.php
file in your config
directory.
Make sure your config/queue.php
file is configured with the desired queue connection. Laravel Horizon relies on Laravel's queue system.
In your .env
file, set the HORIZON_PREFIX
variable to a unique value:
envHORIZON_PREFIX=my-horizon
Run the Horizon database migrations:
bashphp artisan horizon:migrate
You can start Laravel Horizon using the following command:
bashphp artisan horizon
Visit http://your-app-url/horizon
in your browser to access the Horizon dashboard.