当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- Analysis of istio access control
- “他,程序猿,35岁,被劝退”:不要只懂代码,会说话,胜过10倍默默努力
- Istio流量管理--Ingress Gateway
- android基础-CheckBox(复选框)
- 新型存算一体芯片诞生,利好人工智能应用~
- Google's AI model, which can translate 101 languages, is only one more than Facebook
- 2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...
- On monotonous stack
- Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
- Adobe Lightroom / LR 2021 software installation package (with installation tutorial)
猜你喜欢
随机推荐
It's worth seeing! EMR elastic low cost offline big data analysis best practice (with network disk link)
This year's salary is 35W +! Why is the salary of Internet companies getting higher and higher?
wanxin finance
The progress bar written in Python is so wonderful~
Ubuntu20.04下访问FTP服务器乱码问题+上传文件
Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
解析Istio访问控制
阿里出品!视觉计算开发者系列手册(附网盘链接)
Istio流量管理--Ingress Gateway
阿里撕下电商标签
Enabling education innovation and reconstruction with science and technology Huawei implements education informatization
最全!阿里巴巴经济体云原生实践!(附网盘链接)
How to write a resume and project
Ali! Visual computing developer's series of manuals (with internet disk link)
Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
Python Gadgets: code conversion
Xamarin deploys IOS from scratch Walterlv.CloudKeyboard application
Share the experience of passing the PMP examination
Flink: from introduction to Zhenxiang (3. Reading data from collection and file)
Entry level! Teach you how to develop small programs without asking for help (with internet disk link)





