dyned / lumen-maintenance-mode
Maintenance mode command for Lumen
Installs: 8 085
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.0
- laravel/lumen-framework: ^5.6
README
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