azmolla/maintenance-mode

Laravel Maintenance Mode Extension with Database Configuration

1.0.0 2025-03-10 04:33 UTC

This package is auto-updated.

Last update: 2025-04-10 04:54:55 UTC


README

This package provides a simple way to enable and disable maintenance mode for your Laravel application.

Version

Latest Stable Version

Installation

You can install the package via composer:

composer require azmolla/maintenance-mode

Configuration

After installing the package, publish the configuration file and assets:

php artisan maintenance-mode:publish

This will publish the configuration file to config/maintenance-mode.php, the views to resources/views/vendor/maintenance-mode, and the assets to public/vendor/maintenance-mode.

Usage

Middleware

Add the maintenance-mode middleware to your web middleware group in app/Http/Kernel.php:

protected $middlewareGroups = [
    'web' => [
        // Other middleware
        \Azmolla\MaintenanceMode\Http\Middleware\CheckMaintenanceMode::class,
    ],
];

Routes

The package provides routes for managing maintenance mode settings. These routes are defined in src/routes/web.php:

Route::prefix('admin/maintenance')->middleware(['web', 'auth'])->group(function () {
    Route::get('/', [\Azmolla\MaintenanceMode\Controllers\MaintenanceModeController::class, 'index'])->name('admin.maintenance.index');
    Route::post('/update', [\Azmolla\MaintenanceMode\Controllers\MaintenanceModeController::class, 'update'])->name('admin.maintenance.update');
});

Views

The package provides views for displaying and managing maintenance mode settings. These views are located in src/resources/views.

Database

The package includes a migration for creating the maintenance_mode table. Run the migration:

php artisan migrate

Commands

The package provides a command for publishing resources:

php artisan maintenance-mode:publish

Change Log

v1.0.0

  • Initial release

License

This package is open-sourced software licensed under the MIT license.

Author

Contributing

Feel free to submit issues or pull requests. For major changes, please open an issue first to discuss what you would like to change.

Support

If you have any questions or need support, please open an issue on the GitHub repository.