This package provides a command to put a part of your application's routes in maintenance mode. This only affects your HTTP routes, so queues and scheduled tasks will run.
You can install the package via Composer:
composer require digifactory/laravel-partial-down
You can define the parts you want to put in maintenance mode in your middlewares you use for a route or group:
Route::group(['prefix' => 'backend', 'middleware' => 'partialDown:backend'], function () { });
Route::get('backend', function () { })->middleware('partialDown:backend');
Now you can use the artisan commands to put this part of your application in maintenance mode:
php artisan partial-down backend
And partial-up
to bring it back online:
php artisan partial-up backend
The partial-down
command has Laravel's down
command signature:
protected $signature = 'partial-down {part}
{--message= : The message for the maintenance mode}
{--retry= : The number of seconds after which the request may be retried}
{--allow=* : IP or networks allowed to access the application while in maintenance mode}';
When a specific part is down and the IP is not allowed an MaintenanceModeException
will be thrown, by default Laravel handles this exception with a 503 response. You can customize this, please refer the Laravel documentation for more information.
In large applications it can be cumbersome to find all used application parts. You can use the php artisan partial-parts
command to view all used parts:
php artisan partial-parts
+--------------+
| Parts in use |
+--------------+
| backend |
| frontend |
+--------------+
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.