The Exception Handler: The Render Method

Is responsible for converting a given exception into an HTTP response that should be sent back to the browser.

/**
 * Render an exception into an HTTP response.
 *
 * @param  \Illuminate\Http\Request  $request
 * @param  \Exception  $exception
 * @return \Illuminate\Http\Response
 */
public function render($request, Exception $exception)
{
    if ($exception instanceof CustomException) {
        return response()->view('errors.custom', [], 500);
    }

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

The Exception Handler: The Render Method — Structure map

Clickable & Draggable!

The Exception Handler: The Render Method — Related pages: