8ctopus/lumen-7-maintenance-mode

定义应用维护模式。

v1.1.2 2020-07-21 10:42 UTC

This package is auto-updated.

Last update: 2024-09-21 20:44:06 UTC


README

Build Status Latest Stable Version Total Downloads License

php 7.3 Lumen 7.x

如何安装

composer require 8ctopus/lumen-7-maintenance-mode

如何配置

将此代码添加到 AppServiceProvider 或 bootstrap/app.php 文件中

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

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

protected $commands = [
    \oct8pus\MaintenanceMode\Console\Commands\DownCommand::class,
    \oct8pus\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过滤