当前位置:网站首页>Improvement of maintenance mode of laravel8 update
Improvement of maintenance mode of laravel8 update
2020-11-08 13:07:00 【Shenbing general】
Original link :https://www.wjcms.net/archives/laravel8%E6%9B%B4%E6%96%B0%E4%B9%8B%E7%BB%B4%E6%8A%A4%E6%A8%A1%E5%BC%8F%E6%94%B9%E8%BF%9B
Yes php artisan down
The command makes some very nice improvements .
In previous releases , In order to allow only certain people to visit the site , You have to use the whitelist function , As mentioned in this blog post :
Pre render maintenance mode templates are now supported , And it eliminates the chance for end users to encounter errors during maintenance mode . however , So , The following lines must be added to your file . These lines should be placed directly under the existing constant definition :public/index.phpLARAVEL_START
define('LARAVEL_START', microtime(true));
if (file_exists(__DIR__.'/../storage/framework/maintenance.php')) {
require __DIR__.'/../storage/framework/maintenance.php';
}
notes :php artisan down --message
Has been removed
How to create custom Laravel Maintenance page
Use Laravel 8, You can have a secret , Instead of using IP White list . To configure it , All you have to do is :
php artisan down --secret=YOUR_SECRET_HERE
Make sure YOUR_SECRET_HERE Replace parts with safe chords !
Then visit the website in maintenance mode , Please visit Your domain name +/YOUR_SECRET_HERE, This will generate a secret cookie, So you can browse the website as usual !
This is a great way to put your site in maintenance mode , But it still allows some people to access it !
The php artisan down Another great addition to the command is that you can pre render maintenance pages , So even if you run composer update end user , You can still see the maintenance page , Not some mistakes .
So , Just run :
php artisan down --render="errors::503"
such , You can do extensive maintenance , You don't have to worry about users seeing some strange mistakes , And don't worry about the page looking friendly .
The cool thing is , You can put the logo together . for example , You can run the following command to add secrets to the displayed page and change the status code at the same time :
php artisan down --render="errors::503" --status=200 --secret=YOUR_SECRET_HERE
版权声明
本文为[Shenbing general]所创,转载请带上原文链接,感谢
边栏推荐
- Service architecture and transformation optimization process of e-commerce trading platform in mogujie (including ppt)
- Xamarin 从零开始部署 iOS 上的 Walterlv.CloudKeyboard 应用
- Written interview topic: looking for the lost pig
- 啥是数据库范式
- Rabbitmq (1) - basic introduction
- It's worth seeing! EMR elastic low cost offline big data analysis best practice (with network disk link)
- 适合c/c++新手学习的一些项目,别给我错过了!
- android基础-CheckBox(复选框)
- What is the database paradigm
- Enabling education innovation and reconstruction with science and technology Huawei implements education informatization
猜你喜欢
rabbitmq(一)-基础入门
解析Istio访问控制
Implementation of verification code recognition in Python opencv pytesseract
小米、OPPO在欧洲市场继续飙涨,小米更是直逼苹果
Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
Windows下快递投递柜、寄存柜的软件初探
This paper analyzes the top ten Internet of things applications in 2020!
Rust: performance test criteria Library
Powershell 使用.Net对象发送邮件
优化if-else代码的八种方案
随机推荐
On DSA of OpenGL
Stm32uberide download and install - GPIO basic configuration operation - debug (based on CMSIS DAP debug)
Win10 Terminal + WSL 2 安装配置指南,精致开发体验
Windows下快递投递柜、寄存柜的软件初探
C language I blog assignment 03
Major changes in Huawei's cloud: Cloud & AI rises to Huawei's fourth largest BG with full fire
金融领域首个开源中文BERT预训练模型,熵简科技推出FinBERT 1.0
适合c/c++新手学习的一些项目,别给我错过了!
How to deploy pytorch lightning model to production
谷歌开源能翻译101种语言的AI模型,只比Facebook多一种
分布式文档存储数据库之MongoDB基础入门
来自朋友最近阿里、腾讯、美团等P7级Python开发岗位面试题
The container with the most water
Adobe media encoder / me 2021 software installation package (with installation tutorial)
Workers, workers soul, draw lifelong members, become a person!
Where is the new target market? What is the anchored product? |Ten questions 2021 Chinese enterprise service
The progress bar written in Python is so wonderful~
Rust: performance test criteria Library
Bccoin tells you: what is the most reliable investment project at the end of the year!
Ali teaches you how to use the Internet of things platform! (Internet disk link attached)