user() || !$request->user()->bitinflowToken()) { throw new AuthenticationException; } foreach ($scopes as $scope) { if ($request->user()->bitinflowTokenCan($scope)) { return $next($request); } } throw new MissingScopeException($scopes); } }