Download the PHP package axvi/laravel-maintenance without Composer
On this page you can find all versions of the php package axvi/laravel-maintenance. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download axvi/laravel-maintenance
More information about axvi/laravel-maintenance
Files in axvi/laravel-maintenance
Package laravel-maintenance
Short Description Advanced maintenance mode management for Laravel — IP whitelisting, named bypass tokens, scheduled windows, and more.
License MIT
Homepage https://github.com/axvilab/laravel-maintenance
Informations about the package laravel-maintenance
axvi/laravel-maintenance
Advanced maintenance mode management for Laravel 10, 11 and 12.
Features
- IP address whitelisting with optional expiration
- Multiple named bypass tokens (cookie for web, header for APIs, URL bypass)
- Scheduled maintenance windows with auto-disable
- Beautiful, customizable 503 page with countdown timer
- Database-driven — works seamlessly across multiple servers
- Built-in cache layer — avoids DB queries on every request
- Exclude paths from maintenance (health checks, webhooks, etc.)
- Configurable database connection and table names
- Artisan commands for full CLI management
- Events:
MaintenanceModeEnabled,MaintenanceModeDisabled,MaintenanceBypassGranted - Automatically replaces Laravel's built-in maintenance middleware
Requirements
| PHP 8.1 | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 | |
|---|---|---|---|---|---|
| Laravel 10 | yes | yes | yes | yes | — |
| Laravel 11 | — | yes | yes | yes | yes |
| Laravel 12 | — | yes | yes | yes | yes |
Installation
Run migrations:
Migrations are loaded automatically. If you need to customize them:
Optionally publish the config:
Optionally publish the 503 view:
Configuration
After publishing, the config file is located at config/maintenance.php:
Usage
Enable maintenance mode
Disable maintenance mode
Check status
Manage IPs
Manage tokens
Bypass methods
URL bypass (web)
Visit https://yourapp.com/maintenance/{secret-token} — sets a bypass cookie valid for 12 hours.
The route prefix is configurable via bypass_route.prefix in the config. You can also disable URL bypass entirely by setting bypass_route.enabled to false.
Header bypass (API)
The header name is configurable via middleware.header_name in the config.
Exclude paths
Some URLs should always be accessible, even during maintenance. Add patterns to the except array:
Supports wildcards via Laravel's Request::is().
Caching
By default, the package caches the maintenance state and IP whitelist to avoid database queries on every HTTP request. The cache is automatically invalidated when you enable/disable maintenance or modify the IP whitelist.
To disable caching:
To use a specific cache store (e.g. Redis):
Programmatic usage
Events
| Event | Properties |
|---|---|
MaintenanceModeEnabled |
string $message, ?string $endsAt |
MaintenanceModeDisabled |
— |
MaintenanceBypassGranted |
string $type (ip/cookie/header/url), string $value |
How it works
This package replaces Laravel's built-in PreventRequestsDuringMaintenance middleware with its own CheckMaintenanceMode middleware. The bypass check order is:
- Excluded paths — URLs matching
exceptpatterns are always allowed - IP whitelist — if the request IP is in the
maintenance_ipstable (cached) - Cookie — if the request has a valid bypass cookie
- Header — if the request has a valid token in the
X-Maintenance-Tokenheader - 503 response — HTML page with countdown (or JSON for API requests)
All state is stored in the database, so maintenance mode works consistently across multiple application servers. Lookups are cached to minimize performance impact.
Testing
Or directly:
License
MIT — see LICENSE.md.
All versions of laravel-maintenance with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
illuminate/cache Version ^10.0|^11.0|^12.0
illuminate/console Version ^10.0|^11.0|^12.0