承接 bagsiz/laravel-maintenance 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bagsiz/laravel-maintenance

最新稳定版本:v1.0.5

Composer 安装命令:

composer require bagsiz/laravel-maintenance

包简介

A simple maintenance mode package for Laravel applications

README 文档

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

Usage

Using 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.

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固