How to put Laravel app in maintenance mode

Laravel maintenance mode

Sometimes, you don’t need your visitor to be on your website while maintaining it. Laravel has a magic feature called the maintenance mode.

When we turn on the maintenance mode in Laravel, a custom view will be displayed for all requests into your application with a status code of 503 thanks for the instance of Symfony\Component\HttpKernel\Exception\HttpException

Turning on maintenance mode

Laravel made it easy for us to disable our application while updating or performing maintenance. To enable maintenance mode run the down Artisan command:

php artisan down

Customizing the default maintenance mode template

To create your own custom maintenance page all you need to do is to create a new blade page at resources/views/errors/503.blade.php and all the requests will be redirected to this page.

Turning off maintenance mode

To disable maintenance mode, use the up command:

php artisan up

I hope, I could help you, thanks.