PHPackages                             konsulting/laravel-maintenance-mode - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. konsulting/laravel-maintenance-mode

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

konsulting/laravel-maintenance-mode
===================================

Programmatically manage maintenance mode in Laravel apps across multiple servers.

0.4.0(6y ago)826.6k↑105.9%5[1 issues](https://github.com/konsulting/laravel-maintenance-mode/issues)[1 PRs](https://github.com/konsulting/laravel-maintenance-mode/pulls)MITPHPCI failing

Since Jun 4Pushed 6y ago2 watchersCompare

[ Source](https://github.com/konsulting/laravel-maintenance-mode)[ Packagist](https://packagist.org/packages/konsulting/laravel-maintenance-mode)[ RSS](/packages/konsulting-laravel-maintenance-mode/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (5)Versions (8)Used By (0)

Laravel Maintenance Mode
========================

[](#laravel-maintenance-mode)

Installation
------------

[](#installation)

Install via Composer:

```
composer require konsulting/laravel-maintenance-mode

```

Laravel 5.5+ will automatically discover the provider and facade.

### Config

[](#config)

Publish the config file with:

```
php artisan vendor:publish --provider="Konsulting\Laravel\MaintenanceMode\MaintenanceModeProvider"

```

### Middleware

[](#middleware)

The file driver is compatible with Laravel's existing maintenance mode middleware when using the default configuration values.

To use a different driver or a different file path, add the provided `CheckForMaintenanceMode` middleware to `app/Http/Kernel.php`.

```
class Kernel extends HttpKernel
{
    // ...
    protected $middleware = [
        \Konsulting\Laravel\MaintenanceMode\Middleware\CheckForMaintenanceMode::class,

        // You can remove the Illuminate CheckForMaintenanceMode middleware or leave it in
        \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
        // ...
    ];
}
```

Basic usage
-----------

[](#basic-usage)

By default, the Laravel `artisan up` and `artisan down` commands are overridden and so may be used to activate and deactivate maintenance mode using the selected driver. If `override_illuminate_commands` is set to `false` in the config, the commands for maintenance mode are `site:up` and `site:down`.

The behaviour of maintenance mode is similar to Laravel's default `artisan up`/`artisan down` commands. When activated, the a payload containing information about the outage is stored using the chosen driver. This is picked up by the middleware, which throws `Illuminate\Foundation\Http\Exceptions\MaintenanceModeException` if maintenance mode is active. Laravel's exception handler deals with returning the correct response.

### Drivers

[](#drivers)

By default there are three drivers included: file, cache and storage. The file driver is very similar to Laravel's built in maintenance mode in that it stores a payload file in the local filesystem. The cache and storage drivers are useful for when multiple webservers are serving the application, as they can be easily configured to store the payload at an external location such as a cache server.

See the configuration file for more information about the drivers.

Programmatic usage
------------------

[](#programmatic-usage)

### Instantiation

[](#instantiation)

The available drivers are: cache, file, and storage. More detail is contained in `config/maintenance_mode.php`.

```
$driver = new FileDriver(['file_path' => '/path/to/file']);
$maintenanceMode = new MaintenanceMode($driver);
```

### Activating maintenance mode

[](#activating-maintenance-mode)

Maintenance mode is activated with the `MaintenanceMode::on()` method.

When maintenance mode is activated, a payload object is created with the information given and stored by the chosen driver. This contains information about the site being taken down, including the at which maintenance mode was activated, the seconds between retry requests, any IP addresses that are allowed to access the site during maintenance mode, and a message associated with the downtime.

```
$message = 'Down for database upgrades.';
$allowedIps = ['192.168.10.10', '127.0.0.1'];
$secondsToRetry = 60;

$maintenanceMode->on($message, $allowedIps, $secondsToRetry);

$maintenanceMode->isOn(); // true
```

### Retrieving down information

[](#retrieving-down-information)

```
$retrievedPayload = $maintenanceMode->getDownInformation();
// new DownPayload([
//     'time'    => Carbon::now()->getTimestamp(),
//     'message' => 'Down for database upgrades.',
//     'retry'   => 60,
//     'allowed' => ['192.168.10.10', '127.0.0.1'],
// ]);
```

### Deactivating maintenance mode

[](#deactivating-maintenance-mode)

Maintenance mode is deactivated with the `MaintenanceMode::off()` method.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~82 days

Recently: every ~117 days

Total

7

Last Release

2462d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bae802ba5a70c050135022ed88fc558d2ac76ace8e5b67ce176f683d1a0afc1b?d=identicon)[rdarcy1](/maintainers/rdarcy1)

---

Top Contributors

[![rdarcy1](https://avatars.githubusercontent.com/u/15962421?v=4)](https://github.com/rdarcy1 "rdarcy1 (37 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/konsulting-laravel-maintenance-mode/health.svg)

```
[![Health](https://phpackages.com/badges/konsulting-laravel-maintenance-mode/health.svg)](https://phpackages.com/packages/konsulting-laravel-maintenance-mode)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M10](/packages/renatomarinho-laravel-page-speed)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M282](/packages/illuminate-pipeline)[illuminate/redis

The Illuminate Redis package.

8314.6M375](/packages/illuminate-redis)[illuminate/cookie

The Illuminate Cookie package.

244.6M137](/packages/illuminate-cookie)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
