codenrx/maintaince

此Laravel扩展包使您能够将您的网站设置为“建设中”和“维护中”模式

dev-master 2019-09-21 18:06 UTC

This package is auto-updated.

Last update: 2024-09-22 04:59:45 UTC


README

issu Status Build Status folk Status contributions welcome Tweet

此Laravel扩展包使您能够将您的网站设置为“建设中”或“维护中”模式

安装

composer require codenrx/maintaince

config/app.php文件的providers数组中添加以下行

codenrx\maintaince\maintainceServiceProvider::class,

然后,使用以下命令在config文件夹中发布包配置文件(maintaince.php)和在views\vendor\maintaince文件夹中的模板。

php artisan vendor:publish --provider="codenrx\maintaince\maintainceServiceProvider"

打开app\Http\Kernel.php并添加以下行

protected $middleware = [
     .....................
     ..................
     \codenrx\maintaince\App\Http\Middleware\maintainceWare::class,
];

用法

使用以下命令启用维护模式

php artisan make:maintaince on

您也可以使用以下命令启用建设中的模式

php artisan make:maintaince underconstruction

禁用维护模式

php artisan make:maintaince off

自定义

您还可以自定义模板。您需要进入/resources/views/vendor/maintaince

对于某些设置,您可以在config文件夹中的配置文件(maintaince.php)中查看

模板致谢: ❤️ Colorlib

更多信息

享受!