Sometimes we need to down our site for maintenance purposes. Luckily laravel gives the way to turn on maintenance mood with a command.
php artisan down
we can bypass the website with a secret key.
php artisan down --secret="abc123xyz"
and after that, we can access the site with the following URL.
https://yourdomain.com/abc123xyz
You also can redirect the user to a specific error page while the Maintenance mood on.
php artisan down --redirect=/
Custom Page Setup while Laravel Maintenance Mode on
First of all, you have to create a custom blade page on your view directory.
example: maintenance.blade.phpAfter that run this on Terminal
php artisan down --render="maintenance"
- If your blade page is placed in a directory then use “::“ before the blade name. example:
php artisan down --render="directoryName::maintenance"
Top comments (0)