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

v1.0.3 2025-12-14 12:19 UTC

This package is auto-updated.

Last update: 2025-12-14 12:20:00 UTC


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.