Top Related Projects
Websockets for Laravel. Done right.
Clockwork - php dev tools in your browser - server-side component
Debugbar for Laravel (Integrates PHP Debug Bar)
:dromedary_camel: Laravel log viewer
Quick Overview
Laravel Horizon is a beautiful dashboard and code-driven configuration for Laravel's powerful queue system. It provides a user-friendly interface to monitor and manage your Redis-backed queues and workers.
Pros
- Intuitive Dashboard: Horizon offers a visually appealing and user-friendly dashboard that provides real-time insights into your queue system, including job statistics, worker health, and more.
- Customizable Configuration: Horizon allows you to define your queue configuration programmatically, making it easy to manage and version control your queue setup.
- Monitoring and Alerting: Horizon monitors your queue system and can send alerts when issues arise, helping you stay on top of potential problems.
- Seamless Integration: Horizon is tightly integrated with the Laravel framework, making it easy to set up and use within your existing Laravel applications.
Cons
- Redis Dependency: Horizon requires a Redis server to function, which may not be suitable for all deployment environments.
- Limited Scalability: While Horizon can handle a decent amount of queue traffic, it may not be the best choice for extremely high-volume queue systems.
- Learning Curve: Developers new to Laravel or queue management may need to invest some time to fully understand and leverage Horizon's features.
- Limited Customization: Horizon provides a good set of features, but some users may find the level of customization and extensibility to be limited compared to building a custom queue management solution.
Getting Started
To get started with Laravel Horizon, follow these steps:
- Install the Horizon package using Composer:
composer require laravel/horizon
- Publish the Horizon configuration files:
php artisan horizon:install
- Start the Horizon process:
php artisan horizon
- Configure your queue workers in the
config/horizon.php
file. Here's an example configuration:
'environments' => [
'production' => [
'supervisor-1' => [
'connection' => 'redis',
'queue' => ['default'],
'balance' => 'simple',
'processes' => 10,
'tries' => 3,
],
],
],
- Customize the Horizon dashboard by modifying the
resources/views/vendor/horizon
directory.
That's the basic setup to get started with Laravel Horizon. For more advanced configuration and usage, please refer to the official Horizon documentation.
Competitor Comparisons
Websockets for Laravel. Done right.
Pros of Laravel WebSockets
- Provides a simple and lightweight WebSocket server implementation for Laravel applications.
- Supports multiple WebSocket drivers, including Pusher, Socket.IO, and custom implementations.
- Offers a user-friendly API for managing WebSocket connections and broadcasting events.
Cons of Laravel WebSockets
- May not offer the same level of advanced features and monitoring capabilities as Horizon.
- Might require more manual configuration and setup compared to the out-of-the-box experience of Horizon.
- Might have a smaller community and ecosystem compared to the more established Horizon project.
Code Comparison
Laravel Horizon
$supervisor = new Supervisor(
$this->app->make(RedisQueue::class),
$this->app->make(Dispatcher::class),
$this->app->make(EventDispatcher::class),
$this->app->make(Encrypter::class)
);
$supervisor->monitor('default', function (WorkerOptions $options) {
$options->balance('auto');
});
Laravel WebSockets
use BeyondCode\LaravelWebSockets\WebSocketHandler;
class MyWebSocketHandler extends WebSocketHandler
{
public function onOpen(ConnectionInterface $connection): void
{
// Handle WebSocket connection open event
}
public function onMessage(ConnectionInterface $connection, $message): void
{
// Handle WebSocket message event
}
}
Clockwork - php dev tools in your browser - server-side component
Pros of Clockwork
- Clockwork provides a comprehensive debugging and profiling tool for Laravel applications, offering insights into the application's performance, database queries, and more.
- Clockwork is framework-agnostic, meaning it can be used with other PHP frameworks beyond Laravel, making it a more versatile tool.
- Clockwork offers a user-friendly web interface for easy access to debugging information.
Cons of Clockwork
- Clockwork may not provide the same level of advanced features and customization options as Horizon, which is specifically designed for Laravel's job processing system.
- Clockwork may not have the same level of community support and documentation as Horizon, which is an official Laravel package.
Code Comparison
Horizon:
$supervisor = new Supervisor(
$connection = 'redis',
$queue = 'default',
$balance = 'simple',
$maxProcesses = 10,
$maxTasksPerProcess = 1,
$memory = 128,
$timeout = 60,
$sleep = 3,
$tries = 3
);
Clockwork:
Clockwork::info('This is an informational message');
Clockwork::warning('This is a warning message');
Clockwork::error('This is an error message');
Debugbar for Laravel (Integrates PHP Debug Bar)
Pros of Laravel Debugbar
- Provides a comprehensive set of debugging tools, including a timeline, database queries, logs, and more, all within the browser.
- Offers a user-friendly interface that makes it easy to quickly identify and fix issues in your application.
- Supports a wide range of Laravel versions, ensuring compatibility with your project.
Cons of Laravel Debugbar
- Can potentially slow down your application's performance, especially on production servers, due to the additional overhead.
- May not be suitable for large-scale, high-traffic applications where performance is a critical concern.
- Requires manual configuration and setup, which can be time-consuming for developers new to the tool.
Code Comparison
Laravel Horizon
$supervisor = Horizon::supervisorFor('default');
$supervisor->scale(10);
Laravel Debugbar
\Debugbar::info('This is some useful information');
\Debugbar::error('Something went wrong!');
\Debugbar::addMessage('A random message', 'custom');
:dromedary_camel: Laravel log viewer
Pros of Laravel Log Viewer
- Simplicity: Laravel Log Viewer is a lightweight and straightforward package that provides a user-friendly interface for viewing and managing your application's logs.
- Customization: The package offers various configuration options, allowing you to customize the appearance and behavior of the log viewer to suit your needs.
- Easy Integration: Integrating Laravel Log Viewer into your Laravel project is a breeze, with clear documentation and a simple setup process.
Cons of Laravel Log Viewer
- Limited Functionality: Compared to Horizon, Laravel Log Viewer has a more limited set of features, focusing primarily on log viewing and management.
- No Real-Time Monitoring: Unlike Horizon, Laravel Log Viewer does not provide real-time monitoring capabilities for your application's queues and jobs.
Code Comparison
Here's a brief code comparison between Laravel Log Viewer and Horizon:
Laravel Log Viewer (rap2hpoutre/laravel-log-viewer)
Route::get('logs', '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index');
Laravel Horizon (laravel/horizon)
Horizon::auth(function ($request) {
// Return true to allow the request...
return true;
});
Horizon::route('metrics', function () {
return Horizon::metrics();
});
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Introduction
Horizon provides a beautiful dashboard and code-driven configuration for your Laravel powered Redis queues. Horizon allows you to easily monitor key metrics of your queue system such as job throughput, runtime, and job failures.
All of your worker configuration is stored in a single, simple configuration file, allowing your configuration to stay in source control where your entire team can collaborate.
Official Documentation
Documentation for Horizon can be found on the Laravel website.
Contributing
Thank you for considering contributing to Horizon! The contribution guide can be found in the Laravel documentation.
Code of Conduct
In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
License
Laravel Horizon is open-sourced software licensed under the MIT license.
Top Related Projects
Websockets for Laravel. Done right.
Clockwork - php dev tools in your browser - server-side component
Debugbar for Laravel (Integrates PHP Debug Bar)
:dromedary_camel: Laravel log viewer
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot