Handler
in package
implements
ExceptionHandler
Interfaces, Classes and Traits
Table of Contents
- $container : Container
- The container implementation.
- $dontFlash : array<string|int, mixed>
- A list of the inputs that are never flashed for validation exceptions.
- $dontReport : array<string|int, mixed>
- A list of the exception types that are not reported.
- $internalDontReport : array<string|int, mixed>
- A list of the internal exception types that should not be reported.
- __construct() : void
- Create a new exception handler instance.
- render() : Response
- Render an exception into a response.
- renderForConsole() : void
- Render an exception to the console.
- report() : mixed
- Report or log an exception.
- shouldReport() : bool
- Determine if the exception should be reported.
- context() : array<string|int, mixed>
- Get the default context variables for logging.
- convertExceptionToArray() : array<string|int, mixed>
- Convert the given exception to an array.
- convertExceptionToResponse() : Response
- Create a Symfony response for the given exception.
- convertValidationExceptionToResponse() : Response
- Create a response object from the given validation exception.
- invalid() : Response
- Convert a validation exception into a response.
- invalidJson() : JsonResponse
- Convert a validation exception into a JSON response.
- isHttpException() : bool
- Determine if the given exception is an HTTP exception.
- prepareException() : Exception
- Prepare exception for rendering.
- prepareJsonResponse() : JsonResponse
- Prepare a JSON response for the given exception.
- prepareResponse() : Response
- Prepare a response for the given exception.
- renderExceptionWithSymfony() : string
- Render an exception to a string using Symfony.
- renderExceptionWithWhoops() : string
- Render an exception to a string using "Whoops".
- renderHttpException() : Response
- Render the given HttpException.
- shouldntReport() : bool
- Determine if the exception is in the "do not report" list.
- toIlluminateResponse() : Response
- Map the given exception into an Illuminate response.
- unauthenticated() : Response
- Convert an authentication exception into a response.
- whoopsHandler() : Handler
- Get the Whoops handler for the application.
Properties
$container
The container implementation.
protected
Container
$container
$dontFlash
A list of the inputs that are never flashed for validation exceptions.
protected
array<string|int, mixed>
$dontFlash
= ['password', 'password_confirmation']
$dontReport
A list of the exception types that are not reported.
protected
array<string|int, mixed>
$dontReport
= []
$internalDontReport
A list of the internal exception types that should not be reported.
protected
array<string|int, mixed>
$internalDontReport
= [IlluminateAuthAuthenticationException::class, IlluminateAuthAccessAuthorizationException::class, SymfonyComponentHttpKernelExceptionHttpException::class, IlluminateHttpExceptionsHttpResponseException::class, IlluminateDatabaseEloquentModelNotFoundException::class, IlluminateSessionTokenMismatchException::class, IlluminateValidationValidationException::class]
Methods
__construct()
Create a new exception handler instance.
public
__construct(Container $container) : void
Parameters
- $container : Container
Return values
void —render()
Render an exception into a response.
public
render(Request $request, Exception $e) : Response
Parameters
- $request : Request
- $e : Exception
Return values
Response —renderForConsole()
Render an exception to the console.
public
renderForConsole(OutputInterface $output, Exception $e) : void
Parameters
- $output : OutputInterface
- $e : Exception
Return values
void —report()
Report or log an exception.
public
report(Exception $e) : mixed
Parameters
- $e : Exception
Tags
Return values
mixed —shouldReport()
Determine if the exception should be reported.
public
shouldReport(Exception $e) : bool
Parameters
- $e : Exception
Return values
bool —context()
Get the default context variables for logging.
protected
context() : array<string|int, mixed>
Return values
array<string|int, mixed> —convertExceptionToArray()
Convert the given exception to an array.
protected
convertExceptionToArray(Exception $e) : array<string|int, mixed>
Parameters
- $e : Exception
Return values
array<string|int, mixed> —convertExceptionToResponse()
Create a Symfony response for the given exception.
protected
convertExceptionToResponse(Exception $e) : Response
Parameters
- $e : Exception
Return values
Response —convertValidationExceptionToResponse()
Create a response object from the given validation exception.
protected
convertValidationExceptionToResponse(ValidationException $e, Request $request) : Response
Parameters
- $e : ValidationException
- $request : Request
Return values
Response —invalid()
Convert a validation exception into a response.
protected
invalid(Request $request, ValidationException $exception) : Response
Parameters
- $request : Request
- $exception : ValidationException
Return values
Response —invalidJson()
Convert a validation exception into a JSON response.
protected
invalidJson(Request $request, ValidationException $exception) : JsonResponse
Parameters
- $request : Request
- $exception : ValidationException
Return values
JsonResponse —isHttpException()
Determine if the given exception is an HTTP exception.
protected
isHttpException(Exception $e) : bool
Parameters
- $e : Exception
Return values
bool —prepareException()
Prepare exception for rendering.
protected
prepareException(Exception $e) : Exception
Parameters
- $e : Exception
Return values
Exception —prepareJsonResponse()
Prepare a JSON response for the given exception.
protected
prepareJsonResponse(Request $request, Exception $e) : JsonResponse
Parameters
- $request : Request
- $e : Exception
Return values
JsonResponse —prepareResponse()
Prepare a response for the given exception.
protected
prepareResponse(Request $request, Exception $e) : Response
Parameters
- $request : Request
- $e : Exception
Return values
Response —renderExceptionWithSymfony()
Render an exception to a string using Symfony.
protected
renderExceptionWithSymfony(Exception $e, bool $debug) : string
Parameters
- $e : Exception
- $debug : bool
Return values
string —renderExceptionWithWhoops()
Render an exception to a string using "Whoops".
protected
renderExceptionWithWhoops(Exception $e) : string
Parameters
- $e : Exception
Return values
string —renderHttpException()
Render the given HttpException.
protected
renderHttpException(HttpException $e) : Response
Parameters
- $e : HttpException
Return values
Response —shouldntReport()
Determine if the exception is in the "do not report" list.
protected
shouldntReport(Exception $e) : bool
Parameters
- $e : Exception
Return values
bool —toIlluminateResponse()
Map the given exception into an Illuminate response.
protected
toIlluminateResponse(Response $response, Exception $e) : Response
Parameters
- $response : Response
- $e : Exception
Return values
Response —unauthenticated()
Convert an authentication exception into a response.
protected
unauthenticated(Request $request, AuthenticationException $exception) : Response
Parameters
- $request : Request
- $exception : AuthenticationException
Return values
Response —whoopsHandler()
Get the Whoops handler for the application.
protected
whoopsHandler() : Handler