laravel/horizon
Laravel Horizon adds a beautiful dashboard and code-driven configuration for Laravel Redis queues. Monitor throughput, runtime, and failures, manage workers and supervisors from a single config file, and keep queue operations visible and maintainable.
config/horizon.php), enabling team collaboration and version-controlled queue management.redis:cluster for scaling).| Risk Area | Assessment | Mitigation Strategy |
|---|---|---|
| Redis Dependency | Critical for functionality; downtime = queue paralysis. | Implement Redis HA (sentinel/cluster) and fallback queue drivers (e.g., database). |
| Dashboard Overhead | Frontend (Vite) adds ~500KB JS; may impact cold starts. | Lazy-load Horizon dashboard in non-critical paths; use server-side rendering for metrics. |
| Job Monitoring Gaps | Limited visibility into third-party jobs (non-Laravel classes). | Extend Horizon’s JobProcessor or use custom middleware for instrumentation. |
| Scaling Limits | Single Redis instance may bottleneck under high throughput. | Deploy Redis Cluster (supported since v5.46.0) or shard queues by connection. |
| Legacy Laravel | Older Laravel versions (<10) may lack full feature parity. | Test on Laravel 10+; use composer platform checks to enforce compatibility. |
local env support).dispatch(), jobs, and workers.| Step | Action | Tools/Commands |
|---|---|---|
| 1. Prereq Check | Verify Redis and Laravel compatibility (PHP 8.1+, Laravel 10+). | composer require laravel/horizon + php artisan horizon:install |
| 2. Config | Define queue workers in config/horizon.php (e.g., supervisors, connections). |
Edit config/horizon.php; use php artisan horizon:configure. |
| 3. Dashboard | Publish Horizon’s assets (optional; disable with --no-dashboard). |
php artisan horizon:publish --tag=config + npm install && npm run dev. |
| 4. Test | Validate with horizon:listen (CLI) or horizon:work (dashboard). |
php artisan horizon:listen --supervisor=supervisor-name. |
| 5. Monitor | Set up health checks and alerts (e.g., failed jobs > X). | Use Horizon’s failed jobs table + external tools (e.g., Datadog). |
| 6. Scale | Add Redis Cluster or shard queues by connection. | Update config/horizon.php with redis:cluster connection. |
App\Jobs\SendEmail works; Vendor\Lib\Task may not).Horizon\JobProcessor or use tags to categorize jobs.emails).supervisors in horizon.php).config/horizon.php (version-controlled).composer) for security patches.npm run dev after Laravel updates.horizon:terminate (graceful shutdown).horizon:flush (clear queues; use cautiously).horizon:retry (requeue failed jobs).config/horizon.php and Redis server status.npm run dev) and storage/framework/views permissions.How can I help you explore Laravel packages today?