App\Exceptions\UnauthorizedExceptionHandler::handle PHP Method

handle() public method

public handle ( UnauthorizedHttpException $exception ) : mixed
$exception Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException
return mixed
    public function handle(UnauthorizedHttpException $exception)
    {
        return Response::make(['errors' => ['status' => '401', 'code' => 'AuthenticationFailed', 'title' => 'Authentication Failed', 'detail' => 'Failed to authenticate because of bad credentials or an invalid authorization header.', 'source' => ['parameter' => 'Authentication-header']]], 401);
    }
UnauthorizedExceptionHandler