diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 53617ef4..37653f41 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -3,6 +3,7 @@ namespace App\Exceptions; use Exception; +use Illuminate\Auth\AuthenticationException; use Illuminate\Validation\ValidationException; use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Database\Eloquent\ModelNotFoundException; @@ -17,12 +18,25 @@ class Handler extends ExceptionHandler * @var array */ protected $dontReport = [ + AuthenticationException::class, AuthorizationException::class, HttpException::class, ModelNotFoundException::class, ValidationException::class, ]; + /** + * Convert an authentication exception into an unauthenticated response. + * + * @param \Illuminate\Http\Request $request + * @param \Illuminate\Auth\AuthenticationException $e + * @return \Symfony\Component\HttpFoundation\Response + */ + protected function unauthenticated($request, AuthenticationException $e) + { + parent::unauthenticated($request, $e); + } + /** * Report or log an exception. *