DEV Community

Cover image for How to do maintenance on a live website (Laravel 8)
Khwaja Billal Siddiqi
Khwaja Billal Siddiqi

Posted on

5 1

How to do maintenance on a live website (Laravel 8)

Maintenance injects fresh blood into the application.

After deploying your application to production it needs to be maintained. So Laravel makes it easy for you.
To active maintenance mode, you just need to run this command

php artisan down
Enter fullscreen mode Exit fullscreen mode

This will disable your application and show a 503 error page for the user.

By adding a secret key while you enable maintenance mode you can access the application even it’s in maintenance mode

php artisan down --secret="123456789"
Enter fullscreen mode Exit fullscreen mode
https://yourDomain.com/123456789 
Enter fullscreen mode Exit fullscreen mode

What if you want to redirect all requests to a specific route? for doing that just add the flag of redirect while you enable maintenance mode.

php artisan down --redirect=/about
Enter fullscreen mode Exit fullscreen mode

And finally after completing the maintenance run this command to disable maintenance mode & let the user enjoy using your application.

php artisan up
Enter fullscreen mode Exit fullscreen mode

For digging deeper visit: Laravel Maintenance Mode

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (1)

Collapse
 
jovialcore profile image
Chidiebere Chukwudi

Awesome !!!!

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay