Flugg\Responder\Traits\HandlesApiErrors::transformAuthException PHP Method

transformAuthException() protected method

Transform a Laravel auth exception into an API exception.
protected transformAuthException ( Exception $exception ) : void
$exception Exception
return void
    protected function transformAuthException(Exception $exception)
    {
        if ($exception instanceof AuthenticationException) {
            throw new UnauthenticatedException();
        }
        if ($exception instanceof AuthorizationException) {
            throw new UnauthorizedException();
        }
    }