LexikMaintenanceBundle\EventListener\MaintenanceListener), ensuring seamless HTTP-level maintenance mode enforcement.enable/disable) simplify integration into CI/CD pipelines (e.g., GitHub Actions, Jenkins) for automated deployments.kernel.request), enabling custom logic (e.g., logging, notifications) during mode transitions.lexik/maintenance-bundle (abandoned since 2016), risking untested compatibility with modern Laravel (8.x/9.x/10.x) or PHP 8.x features (e.g., attributes, typed properties).MaintenanceListener must be registered before other middleware (e.g., auth, CORS) to intercept all requests..env-based flag).composer require deralia/maintenance-bundle
Add to config/bundles.php (Laravel 5.x) or config/app.php (Laravel 8.x+):
Deralia\MaintenanceBundle\DeraliaMaintenanceBundle::class => ['all' => true],
php artisan config:publish deralia/maintenance-bundle
Customize config/packages/deralia_maintenance.yaml (e.g., whitelisted IPs, storage backend).app/Http/Kernel.php (Laravel 5.x) or via service provider.php bin/console deralia:maintenance:enable
php bin/console deralia:maintenance:disable
symfony/http-kernel).Deralia\MaintenanceBundle\Storage\StorageInterface for non-standard backends (e.g., DynamoDB).- run: php artisan deralia:maintenance:enable
- run: ./deploy-script.sh
- run: php artisan deralia:maintenance:disable
|| in scripts).logging channel).down command or spatie/laravel-maintenance-mode) if the bundle becomes unsustainable.MaintenanceListener logic).dd() in middleware).latency command).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Storage backend unavailable | Maintenance mode stuck enabled/disabled | Use Redis with sentinel or DB with failover. |
| IP whitelist misconfiguration | Unauthorized access to maintenance | Test whitelists with curl -I from various IPs. |
| Bundle PHP version incompatibility | Broken middleware pipeline | Pin PHP version in composer.json. |
| Custom storage adapter failure | Silent failures | Add health checks (e.g., cron job to ping storage). |
How can I help you explore Laravel packages today?