8ctopus/lumen-9-maintenance-mode

定义应用程序维护模式。

1.3.0 2022-03-21 06:13 UTC

This package is auto-updated.

Last update: 2024-09-21 11:43:13 UTC


README

Build Status Latest Stable Version Total Downloads License

php 8.0.2 Lumen 9.x

如何安装

composer require 8ctopus/lumen-9-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 过滤