DEV Community

Cover image for Laravel Maintenance Mode Custom Page Setup
Arman Rahman
Arman Rahman

Posted on • Edited on

2

Laravel Maintenance Mode Custom Page Setup

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
Enter fullscreen mode Exit fullscreen mode

we can bypass the website with a secret key.

php artisan down --secret="abc123xyz"
Enter fullscreen mode Exit fullscreen mode

and after that, we can access the site with the following URL.

https://yourdomain.com/abc123xyz
Enter fullscreen mode Exit fullscreen mode

You also can redirect the user to a specific error page while the Maintenance mood on.

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

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.php

  • After that run this on Terminal

php artisan down --render="maintenance"
Enter fullscreen mode Exit fullscreen mode
  • If your blade page is placed in a directory then use “::“ before the blade name. example:
php artisan down --render="directoryName::maintenance"
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay