当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- Ali tear off the e-commerce label
- Introduction to mongodb foundation of distributed document storage database
- 浅谈OpenGL之DSA
- nat转换的ip跟端口ip不相同的解决方法
- 擅长To C的腾讯,如何借腾讯云在这几个行业云市场占有率第一?
- Automatically generate RSS feeds for docsify
- Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
- Flink from introduction to Zhenxiang (10. Sink data output elasticsearch)
- Istio traffic management -- progress gateway
- 我们做了一个医疗版MNIST数据集,发现常见AutoML算法没那么好用
猜你喜欢
Written interview questions: find the smallest positive integer missing
[Python 1-6] Python tutorial 1 -- number
2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...
Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
PMP考试通过心得分享
Drink soda, a bottle of soda water 1 yuan, two empty bottles can change a bottle of soda, give 20 yuan, how much soda can you
The most complete! Alibaba economy cloud original practice! (Internet disk link attached)
Ali tear off the e-commerce label
Powershell 使用.Net对象发送邮件
随机推荐
Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
This paper analyzes the top ten Internet of things applications in 2020!
Returning to the third place in the world, what did Xiaomi do right?
Adobe Lightroom / LR 2021 software installation package (with installation tutorial)
Flink: from introduction to Zhenxiang (6. Flink implements UDF function - realizes more fine-grained control flow)
rabbitmq(一)-基础入门
谷歌开源能翻译101种语言的AI模型,只比Facebook多一种
2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...
Flink从入门到真香(6、Flink实现UDF函数-实现更细粒度的控制流)
打工人,打工魂,抽终身会员,成为人上人!
Python basic syntax
[Python 1-6] Python tutorial 1 -- number
Hematemesis! Alibaba Android Development Manual! (Internet disk link attached)
原创 | 数据资产确权浅议
Implementation of verification code recognition in Python opencv pytesseract
Ubuntu20.04 access FTP server garbled problem + upload files
阿里云加速增长,进一步巩固领先优势
Android Basics - check box
On the confirmation of original data assets
最全!阿里巴巴经济体云原生实践!(附网盘链接)