App\Exceptions\Handler Class Reference
Inheritance diagram for App\Exceptions\Handler:

Public Member Functions

 report (Exception $e)
 Report or log an exception. More...
 
 render ($request, Exception $e)
 Render an exception into an HTTP response. More...
 

Protected Attributes

 $dontReport
 

Detailed Description

Definition at line 12 of file Handler.php.

Member Function Documentation

App\Exceptions\Handler::render (   $request,
Exception  $e 
)

Render an exception into an HTTP response.

Parameters
\Illuminate\Http\Request$request
\Exception$e
Returns

Definition at line 46 of file Handler.php.

47  {
48  if ($e instanceof \Illuminate\Session\TokenMismatchException) {
49  return redirect()->back()->with('error', trans('general.token_expired'));
50  }
51 
52  if ($this->isHttpException($e)) {
53 
54  $statusCode = $e->getStatusCode();
55 
56  switch ($statusCode) {
57 
58  case '404':
59  return response()->view('layouts/basic', [
60  'content' => view('errors/404')
61  ]);
62  }
63  }
64 
65  return parent::render($request, $e);
66  }
App\Exceptions\Handler::report ( Exception  $e)

Report or log an exception.

This is a great spot to send exceptions to Sentry, Bugsnag, etc.

Parameters
\Exception$e
Returns
void

Definition at line 34 of file Handler.php.

35  {
36  parent::report($e);
37  }

Member Data Documentation

App\Exceptions\Handler::$dontReport
protected
Initial value:
= [
AuthorizationException::class,
HttpException::class,
ModelNotFoundException::class,
ValidationException::class,
]

Definition at line 19 of file Handler.php.


The documentation for this class was generated from the following file: