rik5 / maintenance-mode
A Filament plugin to toggle maintenance mode from the admin panel.
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/rik5/maintenance-mode
Requires
- php: ^8.1
- filament/filament: ^4.0
- illuminate/contracts: ^10.0|^11.0|^12.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.0|^8.0
- orchestra/testbench: ^8.0|^9.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
README
A Filament plugin to toggle maintenance mode from the admin panel.
This plugin is inspired by Keysaw's Laravel Filament Maintenance.
Installation
Install the package via Composer:
composer require rik5/maintenance-mode
Publish the config file:
php artisan vendor:publish --tag="maintenance-mode-config"
Setup
Add the plugin to your Panel configuration:
use Rik5\MaintenanceMode\MaintenanceModePlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ MaintenanceModePlugin::make(), ]); }
Usage
The plugin adds a menu item to the user menu in the Filament admin panel. Clicking it toggles maintenance mode on or off using Laravel's artisan down and up commands.
When enabling maintenance mode, a secret token is generated (or uses the configured one) to bypass the maintenance page.
Configuration
secret: Set a custom secret token or leave as null for auto-generated.refresh: Set refresh interval in seconds or false to disable.permissions: Restrict to users with specific permissions.role: Restrict to users with a specific role.custom_view: Use a custom maintenance page with animation (default: true).block_api: Block API endpoints during maintenance (default: false).
API Access During Maintenance
By default, API endpoints (api/*) are accessible even when maintenance mode is enabled. You can change this by setting block_api to true in the config file.
The package automatically replaces Laravel's default maintenance middleware to respect this configuration.
License
The MIT License (MIT). Please see License File for more information.