Fix display exception handling

This commit is contained in:
DaneEveritt 2022-05-22 18:21:38 -04:00
parent dca53611ff
commit 3f99b00cf7
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 24 additions and 2 deletions

View file

@ -284,4 +284,13 @@ class Handler extends ExceptionHandler
return $previous;
}
/**
* Helper method to allow reaching into the handler to convert an exception
* into the expected array response type.
*/
public static function toArray(Throwable $e): array
{
return (new self(app()))->convertExceptionToArray($e);
}
}