Вход на сайт

Просмотр новости

Найдите то, что Вас интересует

bagsiz/laravel-maintenance

Дата публикации: 04-03-2025 18:41:27

A simple maintenance mode package for Laravel applications

Основное содержимое страницы с новостью.

A simple maintenance mode package for Laravel applications

v1.0.5 2025-03-04 20:09 UTC

This package is auto-updated.

Last update: 2025-03-04 20:09:23 UTC


README

A simple and flexible maintenance mode package for Laravel applications.

Installation

You can install the package via composer:

composer require bagsiz/laravel-maintenance

The package will automatically register its service provider and middleware.

Configuration

You can publish the configuration file and views:

php artisan vendor:publish --provider="Bagsiz\Maintenance\MaintenanceServiceProvider" --tag="maintenance"

This will create:

  • config/maintenance.php - Configuration file
  • resources/views/maintenance/maintenance.blade.php - Default maintenance view
UsageUsing the Facade
use Bagsiz\Maintenance\Facades\Maintenance;

// Enable maintenance mode
Maintenance::enable(['127.0.0.1'], ['admin/*']);

// Disable maintenance mode
Maintenance::disable();

// Check if maintenance mode is enabled
if (Maintenance::isEnabled()) {
    // ...
}

// Get maintenance mode data
$data = Maintenance::getData();
Using Artisan Commands

Enable maintenance mode:

php artisan maintenance on --ip=127.0.0.1 --ip=192.168.1.1 --path=admin/* --path=api/*

Disable maintenance mode:

php artisan maintenance off
Customizing the Maintenance View

The package includes a default maintenance view that you can customize. After publishing the views, you can modify resources/views/maintenance/maintenance.blade.php to match your application's design.

The view includes:

  • A maintenance icon
  • A title and description
  • Maintenance start time
  • Contact information (uses config('app.admin_email'))
Features
  • Enable/disable maintenance mode
  • Allow specific IP addresses to access the application during maintenance
  • Allow specific paths to be accessible during maintenance
  • Command-line interface for easy management
  • Configurable through config file
  • Customizable maintenance view
  • Automatic middleware registration for both web and API routes
  • Simple and lightweight
License

The MIT License (MIT). Please see License File for more information.

Схожие новости

#Наименование новостиТональностьИнформативностьДата публикации
1Как устроен и работает космический корабль «Союз»: ракеты. Сегодня, как ...010.7628-08-2026
2Он отправится к МКС в сентябре Сегодня, 25 августа, на ...07.6525-08-2026

Классификация: . Схожих патентов: 0. Схожих новости: 2. Тональность: 0. Информативность: 0. Источник: packagist.org.