当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- 分布式文档存储数据库之MongoDB基础入门
- Flink from introduction to Zhenxiang (10. Sink data output elasticsearch)
- 你的云服务器可以用来做什么?云服务器有什么用途?
- Written interview topic: looking for the lost pig
- Essential for back-end programmers: distributed transaction Basics
- 值得一看!EMR弹性低成本离线大数据分析最佳实践(附网盘链接)
- Eight ways to optimize if else code
- 2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...
- Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
- Tight supply! Apple's iPhone 12 power chip capacity exposed
猜你喜欢
Tight supply! Apple's iPhone 12 power chip capacity exposed
The first open source Chinese Bert pre training model in the financial field
The network adapter could not establish the connection
Ali teaches you how to use the Internet of things platform! (Internet disk link attached)
C language I blog assignment 03
2018中国云厂商TOP5:阿里云、腾讯云、AWS、电信、联通 ...
金融领域首个开源中文BERT预训练模型,熵简科技推出FinBERT 1.0
This year's salary is 35W +! Why is the salary of Internet companies getting higher and higher?
我们做了一个医疗版MNIST数据集,发现常见AutoML算法没那么好用
rabbitmq(一)-基础入门
随机推荐
WLAN 直连(对等连接或 P2P)调研及iOS跨平台调研
This time Kwai tiktok is faster than shaking.
Xamarin deploys IOS from scratch Walterlv.CloudKeyboard application
软件开发中如何与人协作? | 每日趣闻
How to cooperate with people in software development? |Daily anecdotes
Istio流量管理--Ingress Gateway
What can your cloud server do? What is the purpose of cloud server?
On the confirmation of original data assets
It's worth seeing! EMR elastic low cost offline big data analysis best practice (with network disk link)
一文剖析2020年最火十大物联网应用|IoT Analytics 年度重磅报告出炉!
Analysis of istio access control
PMP心得分享
金融领域首个开源中文BERT预训练模型,熵简科技推出FinBERT 1.0
Flink从入门到真香(6、Flink实现UDF函数-实现更细粒度的控制流)
一文读懂机器学习“数据中毒”
Ubuntu20.04下访问FTP服务器乱码问题+上传文件
Service architecture and transformation optimization process of e-commerce trading platform in mogujie (including ppt)
On the software of express delivery cabinet and deposit cabinet under Windows
【Python 1-6】Python教程之——数字
用 Python 写出来的进度条,竟如此美妙~