When server is down, for every request MaintenanceModeException is thrown and resources/views/errors/503.blade.php is rendered. I'm trying to change it's path but can't figure out where is that exceptions treatment and 503 response.
All http exceptions are handled by the renderHttpException() method inside \Illuminate\Foundation\Exceptions\Handler.php
/**
* Render the given HttpException.
*
* @param \Symfony\Component\HttpKernel\Exception\HttpException $e
* @return \Symfony\Component\HttpFoundation\Response
*/
protected function renderHttpException(HttpException $e)
{
$status = $e->getStatusCode();
if (view()->exists("errors.{$status}")) {
return response()->view("errors.{$status}", ['exception' => $e], $status, $e->getHeaders());
} else {
return $this->convertExceptionToResponse($e);
}
}
I assume you want to display a custom view for that 503 exception. In this case, just create your own 503.blade.php file inside resources/views/errors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With