PHPackages                             spiral-packages/maintenance - 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. spiral-packages/maintenance

ActiveLibrary

spiral-packages/maintenance
===========================

Disable your application while it is updating or when you are performing maintenance.

1.0.1(3y ago)04MITPHPPHP ^8.1

Since Jul 23Pushed 3y ago1 watchersCompare

[ Source](https://github.com/spiral-packages/maintenance)[ Packagist](https://packagist.org/packages/spiral-packages/maintenance)[ Docs](https://github.com/spiralpackages/maintenance)[ RSS](/packages/spiral-packages-maintenance/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (8)Versions (3)Used By (0)

This is my package maintenance
==============================

[](#this-is-my-package-maintenance)

[![PHP](https://camo.githubusercontent.com/d5b24914cb95ea382681f05394c3dd431dacc4f8de4711dd23b47ee1bea8af8c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f73706972616c2d7061636b616765732f6d61696e74656e616e63652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spiral-packages/maintenance)[![Latest Version on Packagist](https://camo.githubusercontent.com/9f35855958d37a62ba5ef574aa1bab276d858136ee9b36483c9d8d2a97f715da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73706972616c2d7061636b616765732f6d61696e74656e616e63652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spiral-packages/maintenance)[![GitHub Tests Action Status](https://camo.githubusercontent.com/60306d7bc4b26fb81471b3ad70810233e254b4ec39b409288bd0d91011f70f95/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f73706972616c2d7061636b616765732f6d61696e74656e616e63652f72756e2d74657374733f6c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/spiral-packages/maintenance/actions?query=workflow%3Arun-tests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/aa12121c4fdd315bff5321c2767d5dd2701c241dd12cb0ae299c5f878fd54bef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73706972616c2d7061636b616765732f6d61696e74656e616e63652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spiral-packages/maintenance)

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Requirements
------------

[](#requirements)

Make sure that your server is configured with following PHP version and extensions:

- PHP 8.1+
- Spiral framework 3.0+

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

[](#installation)

You can install the package via composer:

```
composer require spiral-packages/maintenance
```

After package install you need to register bootloader from the package.

```
protected const LOAD = [
    // ...
    \Spiral\Maintenance\Bootloader\MaintenanceBootloader::class,
];
```

> Note: if you are using [`spiral-packages/discoverer`](https://github.com/spiral-packages/discoverer), you don't need to register bootloader by yourself.

Configuration
-------------

[](#configuration)

By default, the package uses `file` driver for storing information about maintenance mode. If you have multiple instances of your application you need to use `cache` driver with storage that will be accessed from all instances.

```
MAINTENANCE_DRIVER=cache
MAINTENANCE_CACHE_STORAGE=null
MAINTENANCE_CACHE_KEY=maintenance
```

Usage
-----

[](#usage)

Include `Spiral\Maintenance\Middleware\PreventRequestInMaintenanceModeMiddleware` in your application for routes that should not have access during maintenance mode.

```
final class RoutesBootloader extends BaseRoutesBootloader
{
    protected function globalMiddleware(): array
    {
        return [
            \Spiral\Maintenance\Middleware\PreventRequestInMaintenanceModeMiddleware::class,
            // ...
        ];
    }
}
```

To enable maintenance mode, execute the down command:

```
php app.php down
```

By default, response code for maintenance mode is `503`, but you may set custom response code

```
php app.php down --status=504
```

To disable maintenance mode, use the up command:

```
php app.php up
```

When your application is in maintenance mode the middleware throws `Spiral\Maintenance\Exception\MaintenanceModeHttpException` with defined status code.

Spiral Framework allows you to pre-render a maintenance mode view that will be returned to the very beginning of the request cycle. You may pre-render a template of your choice using `App\ErrorHandler\ViewRenderer`. By default, it looks for a template in a folder `app/views/exception/{statusCode}.dark.php`

You can create a new view file `app/views/exception/503.dark.php`:

```

        {{ $exception->getMessage() ?? 'Maintenance mode' }}

```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [butschster](https://github.com/butschster)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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 ~54 days

Total

2

Last Release

1332d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/773481?v=4)[Pavel Buchnev](/maintainers/butschster)[@butschster](https://github.com/butschster)

---

Top Contributors

[![butschster](https://avatars.githubusercontent.com/u/773481?v=4)](https://github.com/butschster "butschster (11 commits)")

---

Tags

maintenancemaintenance-modepackagephpspiralspiral-frameworkphppackagemaintenancespiralspiral-framework maintenance mode

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/spiral-packages-maintenance/health.svg)

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

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[nunomaduro/termwind

It's like Tailwind CSS, but for the console.

2.5k239.8M285](/packages/nunomaduro-termwind)[spiral/temporal-bridge

Temporal integration package for Spiral Framework

58901.5k](/packages/spiral-temporal-bridge)

PHPackages © 2026

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