Create Custom Maintenance Page in Laravel

Published on August 9, 2020 46 sec read

Hi artisan, in this tutorial, we are going to create our custom maintenance page in Laravel. I’m testing on Laravel 7.x. Let’s get started:

Table of Contents

  1. Create Laravel Project
  2. Maintenance Mode
  3. Custom Design

Create Laravel Project

Run this composer command to create Laravel project. If you already have Laravel project, then you can skip this step.

composer create-project --prefer-dist laravel/laravel laratest

Maintenance Mode

To put website into maintenance mode, we have to run this command:

php artisan down

Output:

Application is now in maintenance mode.

To make application up and running again, run this command:

php artisan up

Output:

Application is now live.

Custom Design

Laravel displays 503 page as maintenance page. We can easily override the page. Navigate to resources/views folder and create a directory called errors. Under errors folder, create a file named 503.blade.php & paste your design:

resources/views/errors/503.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Maintenance Mode</title>
</head>
<body>
<div class="container">
    <div style="margin-top: 50px; text-align: center">
        We will be up in couple of minutes. Thanks for patience.
    </div>
</div>
</body>
</html>
That’s it. Thanks for reading. 🙂

Author

Hey, I'm Md Obydullah. I build open-source projects and write on Laravel, Linux server, modern JavaScript and more on web development.

Follow

Leave a Reply

Your email address will not be published. Required fields are marked *