jsilalahi / lumen-maintenance-mode by silalahi

Maintenance mode command for Lumen
7,949
3
1
Package Data
Maintainer Username: silalahi
Maintainer Contact: jsilalahi@dyned.com (Jogi Silalahi)
Package Create Date: 2018-03-09
Package Last Update: 2018-03-09
Home Page: http://dyned.com
Language: PHP
License: Unknown
Last Refreshed: 2024-04-26 03:17:08
Package Statistics
Total Downloads: 7,949
Monthly Downloads: 37
Daily Downloads: 1
Total Stars: 3
Total Watchers: 1
Total Forks: 0
Total Open Issues: 0

:wrench: Lumen Maintenance Mode

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