private function checkOAuthScope($scopeString) { $scopes = []; if ($scopeString !== null) { $scopes = explode(',', $scopeString); } $not_exists = []; foreach ($scopes as $scope_id) { $scope = OAuthScope::where('id', $scope_id)->first(); if (!$scope) { array_push($not_exists, $scope_id); } } return $not_exists; }