How to show 500 internal Server error page in laravel 5.2?

I want to show the page 500 internal server error Page. when user had syntax error mistake in project can anyone help me? if i do some mistake in syntax i want to show that particular blade.

1 Like

You need to create handler to catching FatalErrorExceptions in your handler like below code:

Handler In app/Exceptions/Handler.php

public function render($request, Exception $e)
{

    // 404 page when a model is not found
    if ($e instanceof ModelNotFoundException) {
        return response()->view('errors.404', [], 404);
    }

    // custom error message
    if ($e instanceof \ErrorException) {
        return response()->view('errors.500', [], 500);
    } else {
        return parent::render($request, $e);
    }

    return parent::render($request, $e);
}

View See resources/views/errors/500.blade.php . If not exist then create it.

You can get more detailed OR other ways from Laravel 5 custom error view for 500

Refer: https://stackoverflow.com/questions/41216672/how-to-show-500-internal-server-error-page-in-laravel-5-2