Commit 5bb8fd6b authored by Dillenn Terumalai's avatar Dillenn Terumalai
Browse files

// WIP

parent c24595e9
......@@ -2,6 +2,6 @@
All notable changes to `laravel-cluster` will be documented in this file.
## 1.0.0 - 202X-XX-XX
## 1.0.0 - 2021-06-30
- initial release
- Initial release
# Laravel Cluster provides a unified queueing API and dashboard for cluster systems
<p align="center"><img src=""></p>
[![Latest Version on Packagist](](
[![GitHub Tests Action Status](](
[![GitHub Code Style Action Status](]("Check+%26+fix+styling"+branch%3Amain)
[![Total Downloads](](
## Introduction
This repo can be used as to scaffold a Laravel package. Follow these steps to get started:
Laravel cluster provides a beautiful dashboard and code-driven configuration for your Laravel powered cluster. Larvel cluster allows you to easily monitor key metrics of your cluster system such as job throughput, runtime, and job failures.
1. Press the "Use template" button at the top of this repo to create a new repo with the contents of this laravel-cluster
2. Run "./" to run a script that will replace all placeholders throughout all the files
3. Remove this block of text.
4. Have fun creating your package.
5. If you need help creating a package, consider picking up our <a href="">Laravel Package Training</a> video course.
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
## Support us
[<img src="" width="419px" />](
We invest a lot of resources into creating [best in class open source packages]( You can support us by [buying one of our paid products](
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page]( We publish all received postcards on [our virtual postcard wall](
All of your cluster configuration is stored in a single, simple configuration file, allowing your configuration to stay in source control where your entire team can collaborate.
## Installation
You can install the package via composer:
composer config '{"type": "composer", "url": ""}'
composer require dterumal/laravel-cluster
You can publish and run the migrations with:
After installing Horizon, publish its assets using the `laravel-cluster:install` Artisan command:
php artisan vendor:publish --provider="Dterumal\LaravelCluster\LaravelClusterServiceProvider" --tag="laravel-cluster-migrations"
php artisan migrate
php artisan laravel-cluster:install
You can publish the config file with:
php artisan vendor:publish --provider="Dterumal\LaravelCluster\LaravelClusterServiceProvider" --tag="laravel-cluster-config"
### Configuration
After publishing Laravel cluster's assets, its primary configuration file will be located at `config/laravel-cluster.php`. This configuration file allows you to configure the queue worker options for your application. Each configuration option includes a description of its purpose, so be sure to thoroughly explore this file.
### Migrations
You should also find a migration file `database/migrations/xxxx_xx_xx_xxxxxx_create_cluster_jobs_table` which will create a table to store your jobs information. Make sure that your application is using a database.
### Dashboard Authorization
Laravel cluster exposes a dashboard at the `/laravel-cluster` URI. By default, you will only be able to access this dashboard in the local environment. However, within your app/Providers/LaravelClusterServiceProvider.php file, there is an authorization gate definition. This authorization gate controls access to Laravel cluster in non-local environments. You are free to modify this gate as needed to restrict access to your Laravel cluster installation:
* Register the LaravelCluster gate.
* This gate determines who can access LaravelCluster in non-local environments.
* @return void
protected function gate()
Gate::define('viewLaravelCluster', function ($user) {
return in_array($user->email, [
], true);
This is the contents of the published config file:
### Cluster live information
Laravel cluster includes a metrics dashboard which provides information regarding your jobs. In order to keep this dashboard up to date, you should configure Laravel cluster's `refresh` Artisan command to run every minute via your application's scheduler:
return [
* Define the application's command schedule.
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
protected function schedule(Schedule $schedule)
## Usage
### Notifications
If you would like to be notified when the cluster is unreachable, you may use the LaravelCluster::routeMailNotificationsTo method. You may call this method from the boot method of your application's App\Providers\LaravelClusterServiceProvider:
$laravel-cluster = new Dterumal\LaravelCluster();
echo $laravel-cluster->echoPhrase('Hello, Spatie!');
* Bootstrap any application services.
* @return void
public function boot()
### Clearing jobs from queue
If you would like to delete all pending jobs from the cluster's queue, you may do so using the `laravel-cluster:clear` Artisan command:
php artisan horizon:clear
## Testing
......@@ -71,16 +106,18 @@ Please see [CHANGELOG]( for more information on what has changed re
## Contributing
Please see [CONTRIBUTING](.github/ for details.
Please see [CONTRIBUTING](.gitlab/ for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
Please review [our security policy](.gitlab/ on how to report security vulnerabilities.
## Credits
- [Dillenn Terumalai](
- [All Contributors](../../contributors)
This package is highly inspired from [Laravel Horizon](
- [Dillenn Terumalai](
- [Spatie/Package-Skeleton-Laravel](
## License
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment