How to change be right back message on Laravel - BOOKC -->

How to change be right back message on Laravel

Wednesday, March 22, 2017


When your application is on maintenance mode, it will display 'be right back' message, what if you want to change this message? how to change this 'be right back' message on laravel?

First of all there is a difference between laravel 4 and laravel 5, when it comes to displaying the 'be right back' message. On laravel 4.2 this message is located on global.php, where laravel 5.2 it has dedicated view for displaying the message.

Laravel 4.2
You can find it on app/start/global.php, have a look at the 'Maintenance Mode Handler', under the 'App::down(function()' you will see the code.
/*
|--------------------------------------------------------------------------
| Maintenance Mode Handler
|--------------------------------------------------------------------------
|
| The "down" Artisan command gives you the ability to put an application
| into maintenance mode. Here, you will define what is displayed back
| to the user if maintenance mode is in effect for the application.
|
*/

App::down(function()
{
return Response::make("Be right back!", 503);
});

The default is returning Response class, you can change it to return your own laravel view if you wish.

Laravel 5.2
The 'be right back' message 503 http error in laravel 5.2 have been changed, now it has it's own view, you can find it on resources/views/errors/503.blade.php.
<!DOCTYPE html> 
<html>
<head> <title>Be right back.</title>
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css">

<style>
html, body {
height: 100%;
}

body {
margin: 0;
padding: 0;
width: 100%;
color: #B0BEC5;
display: table;
font-weight: 100;
font-family: 'Lato';
}

.container {
text-align: center;
display: table-cell;
vertical-align: middle;
}

.content {
text-align: center;
display: inline-block;
}

.title {
font-size: 72px;
margin-bottom: 40px;
}
</style>
</head>
<body>
<div class="container">
<div class="content">
<div class="title">Be right back.</div>
</div>
</div>
</body>
</html>

Go ahead edit that file and personalize the error message.