usmanjdn93/lumen-7-maintenance-mode

定义应用维护模式。

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

This package is auto-updated.

Last update: 2024-09-25 21:32:46 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过滤