usmanjdn93/lumen-8-maintenance-mode

定义应用维护模式。

v1.2.0 2020-09-25 11:49 UTC

This package is not auto-updated.

Last update: 2024-09-22 05:36:38 UTC


README

Build Status Latest Stable Version Total Downloads License

php 7.2 Lumen 8.x

如何安装

composer require usmanjdn93/lumen-8-maintenance-mode

如何配置

将其添加到您的 AppServiceProvider 或 bootstrap/app.php

$app->register(\usmanjdn93\MaintenanceMode\Providers\MaintenanceModeServiceProvider::class);

在 app/console/Kernel.php 中添加上/下命令

protected $commands = [
    \usmanjdn93\MaintenanceMode\Console\Commands\DownCommand::class,
    \usmanjdn93\MaintenanceMode\Console\Commands\UpCommand::class
];

开启维护模式

php artisan down

关闭维护模式

php artisan up

基于 IP 的访问

目前仅支持 ipv4,不支持 IP 范围

在 .env 文件中添加 ALLOWED_IPS

ALLOWED_IPS=192.168.1.2,127.0.0.1,136.22.16.0

计划中的功能

  • IP 范围
  • 动态 DNS IP 过滤