New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

justbetter/laravel-horizon-restarter

Automatically restart Laravel Horizon
9,626 2
Install
composer require justbetter/laravel-horizon-restarter
Latest Version:1.1.0
PHP:^8.3
Laravel:12 · 13
Older releases:11
License:MIT
Last Updated:Apr 2, 2026
Links: GitHub  ·  Packagist
Maintainer: justbetter
Banner

Laravel Horizon Restarter

Tests Coverage Analysis Total downloads

Automatically restart Horizon after a given amount of jobs.

Why?

PHP is not designed for long running processes, it can sometimes run into issues when it has been running for too long. Horizon workers can automatically be stopped after processing a configured amount of jobs (maxjobs). However, depending on the balanceMaxShift and balanceCooldown, it may take a while before all processes are running again. This package will automatically restart Horizon gracefully after a given amount of jobs have been processed.

This package is to simplify configuration and to ensure that Horizon is restarted automatically.

Installation

You can install the package via composer:

composer require justbetter/laravel-horizon-restarter

Configuration

By default, after 100.000 jobs have been processed, Horizon will be terminated. This can be configured by adding the following to your .env file:

HORIZON_RESTARTER_THRESHOLD=100000

Quality

To ensure the quality of this package, run the following command:

composer quality

This will execute three tasks:

  1. Makes sure all tests are passed
  2. Checks for any issues using static code analysis
  3. Checks if the code is correctly formatted

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

JustBetter logo

Related Packages

owen-it/laravel-auditing

Audit changes of your Eloquent models in Laravel

43,476,394 3,472
mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

22,513,234 1,979
kyslik/column-sortable

Package for handling column sorting in Laravel 6.x

6,507,424 643
mews/captcha

Laravel 5/6/7/8/9/10/11/12 Captcha Package

6,281,495 2,589
ajthinking/archetype

Programmatically edit PHP and Laravel files.

4,714,337 271

Version History

Version Released PHP Laravel License
1.1.0 ^8.3 ^12.0|^13.0 MIT
1.0.0 ^8.3 ^11.0|^12.0 MIT