当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- On DSA of OpenGL
- 我们做了一个医疗版MNIST数据集,发现常见AutoML算法没那么好用
- 入门级!教你小程序开发不求人(附网盘链接)
- Tidb performance competition 11.02-11.06
- Bccoin tells you: what is the most reliable investment project at the end of the year!
- [Python 1-6] Python tutorial 1 -- number
- 分布式文档存储数据库之MongoDB基础入门
- 分布式文档存储数据库之MongoDB基础入门
- 用 Python 写出来的进度条,竟如此美妙~
- python基本语法 变量
猜你喜欢
Harbor项目高手问答及赠书活动
适合c/c++新手学习的一些项目,别给我错过了!
laravel8更新之速率限制改进
Rust : 性能测试criterion库
分布式文档存储数据库之MongoDB基础入门
The most complete! Alibaba economy cloud original practice! (Internet disk link attached)
Flink: from introduction to Zhenxiang (3. Reading data from collection and file)
Q & A and book giving activities of harbor project experts
Flink从入门到真香(10、Sink数据输出-Elasticsearch)
TiDB 性能竞赛 11.02-11.06
随机推荐
数据库连接报错之IO异常(The Network Adapter could not establish the connection)
Or talk No.19 | Facebook Dr. Tian Yuandong: black box optimization of hidden action set based on Monte Carlo tree search
擅长To C的腾讯,如何借腾讯云在这几个行业云市场占有率第一?
Flink from introduction to Zhenxiang (7. Sink data output file)
金融领域首个开源中文BERT预训练模型,熵简科技推出FinBERT 1.0
Summary of template engine
Eight ways to optimize if else code
这次,快手终于比抖音'快'了!
分布式文档存储数据库之MongoDB基础入门
Essential for back-end programmers: distributed transaction Basics
漫画|讲解一下如何写简历&项目
Understanding design patterns
用 Python 写出来的进度条,竟如此美妙~
Rust: performance test criteria Library
Suitable for C / C + + novice learning some projects, do not give me to miss!
阿里云视频云技术专家 LVS 演讲全文:《“云端一体”的智能媒体生产制作演进之路》
2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...
Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
The progress bar written in Python is so wonderful~
Research on WLAN direct connection (peer-to-peer connection or P2P) and cross platform research of IOS