digifactory / laravel-partial-down
Put specific parts of your application in maintenance mode using
Installs: 7 693
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^8.0.2|^8.1
- laravel/framework: ^9.0
Requires (Dev)
- orchestra/testbench: ^7.1
- phpunit/phpunit: ^9.3
This package is auto-updated.
Last update: 2025-02-14 19:06:51 UTC
README
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.
Installation
You can install the package via Composer:
composer require digifactory/laravel-partial-down
Usage
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.
List used parts
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 |
+--------------+
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email helpdesk@digifactory.nl instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.