user() || !method_exists($request->user(), 'anikeenToken') || !$request->user()->anikeenToken()) { throw new AuthenticationException; } foreach ($scopes as $scope) { if ($request->user()->anikeenTokenCan($scope)) { return $next($request); } } throw new MissingScopeException($scopes); } }