faizalmansor / lumen-6-maintenance-mode
定义应用维护模式。
v1.1.1
2020-01-28 07:47 UTC
Requires
- php: >=7.2
- laravel/lumen-framework: ^6.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.15
- fzaninotto/faker: ^1.4.0
- laravel/lumen: ~6.0
- phpunit/phpunit: ~7.0
This package is auto-updated.
Last update: 2024-09-28 19:45:48 UTC
README
php 7.3 Lumen 6.2
如何安装
composer require faizalmansor/lumen-6-maintenance-mode
如何配置
将此代码添加到您的 AppServiceProvider 或在 bootstrap/app.php 中
$app->register(
faizalmansor\MaintenanceMode\Providers\MaintenanceModeServiceProvider::class
);
在 app/console/Kernel.php 中添加 up 和 down 命令
protected $commands = [
\faizalmansor\MaintenanceMode\Console\Commands\DownCommand::class,
\faizalmansor\MaintenanceMode\Console\Commands\UpCommand::class
];
开启维护模式
php artisan down
关闭维护模式
php artisan up
基于 IP 的访问
当前仅支持 ipv4,且不支持 ipranges
在 .env 文件中添加 ALLOWED_IPS
ALLOWED_IPS=192.168.1.2,127.0.0.1,136.22.16.0
计划中的功能
- IP 范围
- 动态 DNS IP 过滤