- Does Laravel Horizon work with Laravel 13 or 12? What’s the latest version support?
- Yes, Horizon v5.x is officially supported for Laravel 13 and 12. Check the [Laravel docs](https://laravel.com/docs/horizon) for version-specific requirements. Older Laravel versions (9/10) may need Horizon v4.x, but v5.x is the recommended path for new projects.
- Can I use Horizon with database queues instead of Redis?
- Horizon is optimized for Redis queues and does not natively support database queues. While workarounds exist (like custom drivers), they’re unsupported and may introduce instability. Stick to Redis for full feature parity.
- How do I configure Horizon workers for high availability in production?
- Use a process supervisor like Supervisor or Docker to manage multiple Horizon workers. Configure `supervisor.json` or Docker Compose to distribute load across instances. Horizon’s `balance` option in `config/horizon.php` helps distribute jobs evenly.
- What’s the best way to migrate from `php artisan queue:work` to Horizon?
- Start by running Horizon in parallel with legacy workers (`php artisan horizon`). Monitor jobs via the dashboard to verify metrics. Once confident, replace `queue:work` with `horizon:listen` in your supervisor config and restart workers.
- Does Horizon support delayed jobs or batch processing?
- Yes, Horizon fully supports Laravel’s delayed jobs and batch processing. Configure `delay` in your job class or use `dispatch()->delay()` for delayed execution. Batch processing is handled via Redis lists and Horizon’s built-in batching logic.
- How do I customize the Horizon dashboard or add my own metrics?
- Extend the dashboard by publishing Horizon’s assets (`php artisan vendor:publish --tag=horizon-assets`) and modifying the Vue.js components in `resources/js/horizon`. For custom metrics, emit Laravel events (e.g., `JobProcessed`) and listen in your app.
- What’s the impact of Horizon on PHP memory usage? How do I optimize?
- Horizon workers consume memory like standard Laravel queue workers, but Redis optimizations reduce overhead. Monitor memory with `horizon:monitor` and adjust `memory` limits in `config/horizon.php`. Use `horizon:terminate` to force-kill stuck workers if needed.
- Can I integrate Horizon with Laravel Forge or Valet for deployment?
- Yes, Horizon works seamlessly with Forge (via Supervisor) and Valet (using `valet horizon`). Forge provides pre-configured Supervisor templates, while Valet’s CLI wrapper simplifies local testing. Docker deployments require custom `supervisor.json` or Docker Compose files.
- Are there alternatives to Horizon for Laravel queue monitoring?
- For Redis queues, Horizon is the most integrated option. Alternatives like **Spatie’s Horizon Scheduler** (for cron-like jobs) or **Laravel Telescope** (for broader debugging) exist, but none match Horizon’s depth for queue-specific metrics. For non-Redis queues, consider **Laravel Queue Monitor** (database-based).
- How do I handle job failures or retries in Horizon?
- Horizon surfaces failed jobs in the dashboard under the “Failed Jobs” tab. Retry failed jobs manually or automate retries via Laravel’s `retryAfter()` middleware. For bulk retries, use `php artisan horizon:retry` or integrate with a monitoring tool like Sentry.