Create Custom Maintenance Page in Laravel
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
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:
<!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.
Md Obydullah
Software Engineer | Ethical Hacker & Cybersecurity...
Md Obydullah is a software engineer and full stack developer specialist at Laravel, Django, Vue.js, Node.js, Android, Linux Server, and Ethichal Hacking.