dyned/lumen-maintenance-mode

There is no license information available for the latest version (v1.0.0) of this package.

Maintenance mode command for Lumen

v1.0.0 2018-03-09 07:48 UTC

This package is auto-updated.

Last update: 2024-10-20 18:33:25 UTC


README

GitHub release

In Laravel framework, maintenance mode provided out of the box. Unfortunately, this feature not available in Lumen framework.

This library will bring back maintenance mode command for Lumen framework with customize JSON response.

Installation

Require this package with composer. It is recommended to only require the package for development.

composer require dyned/lumen-maintenance-mode

And then register the Maintenance Mode in Lumen Service Provider bootstrap/app.php file:

$app->register(DynEd\Lumen\MaintenanceMode\MaintenanceModeServiceProvider::class);

Usage

To enable maintenance mode, execute the down Artisan command:

php artisan down

When maintenance mode enabled, the maintenance response returned for each routes called.

You may also provide message and retry options to the down command. The message value may be used to display message in JSON response, while the retry value will used for retry in seconds before the application is available again:

php artisan down --message="Upgrading Database" --retry=60

To disable maintenance mode, use the up command:

php artisan up

TODO

  • Creating config for JSON response