{"action":"created","comment":{"url":"https://api.github.com/repos/DoSomething/northstar/pulls/comments/36789594","id":36789594,"diff_hunk":"@@ -14,13 +14,23 @@ class UserController extends Controller\n     /**\n      * Display a listing of the resource.\n      * GET /users\n+     * Get /users?attr1=value1&attr2=value2&...\n      *\n      * @return Response\n      */\n     public function index()\n     {\n-        $query = User::query();\n-        return $this->respondPaginated($query);\n+        $inputs = Input::all();\n+        if(empty($inputs)){\n+            $query = User::query();\n+            return $this->respondPaginated($query);\n+        }else{\n+            $users = User::where($inputs)->paginate(20);","path":"app/Http/Controllers/UserController.php","position":17,"original_position":17,"commit_id":"a80baf30fd48f9cb4e7536fdde4db9dc9a8e4f08","original_commit_id":"a80baf30fd48f9cb4e7536fdde4db9dc9a8e4f08","user":{"login":"jonuy","id":696595,"avatar_url":"https://avatars.githubusercontent.com/u/696595?v=3","gravatar_id":"","url":"https://api.github.com/users/jonuy","html_url":"https://github.com/jonuy","followers_url":"https://api.github.com/users/jonuy/followers","following_url":"https://api.github.com/users/jonuy/following{/other_user}","gists_url":"https://api.github.com/users/jonuy/gists{/gist_id}","starred_url":"https://api.github.com/users/jonuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonuy/subscriptions","organizations_url":"https://api.github.com/users/jonuy/orgs","repos_url":"https://api.github.com/users/jonuy/repos","events_url":"https://api.github.com/users/jonuy/events{/privacy}","received_events_url":"https://api.github.com/users/jonuy/received_events","type":"User","site_admin":false},"body":"ok, so I'm not entirely sure, but does `User::where()` return a type query `Builder`? In which case you could do something like...\r\n```\r\nreturn $this->respondPaginated(User::where($inputs));\r\n```\r\n\r\nIt'd simplify the logic a little, would allow us to still use the `respondPaginated` function to do the pagination work, and avoids us having to throw an Exception.","created_at":"2015-08-11T19:46:40Z","updated_at":"2015-08-11T19:46:40Z","html_url":"https://github.com/DoSomething/northstar/pull/196#discussion_r36789594","pull_request_url":"https://api.github.com/repos/DoSomething/northstar/pulls/196","_links":{"self":{"href":"https://api.github.com/repos/DoSomething/northstar/pulls/comments/36789594"},"html":{"href":"https://github.com/DoSomething/northstar/pull/196#discussion_r36789594"},"pull_request":{"href":"https://api.github.com/repos/DoSomething/northstar/pulls/196"}}},"pull_request":{"url":"https://api.github.com/repos/DoSomething/northstar/pulls/196","id":42048764,"html_url":"https://github.com/DoSomething/northstar/pull/196","diff_url":"https://github.com/DoSomething/northstar/pull/196.diff","patch_url":"https://github.com/DoSomething/northstar/pull/196.patch","issue_url":"https://api.github.com/repos/DoSomething/northstar/issues/196","number":196,"state":"open","locked":false,"title":"Get Users by sources endpoint","user":{"login":"axton21","id":10498035,"avatar_url":"https://avatars.githubusercontent.com/u/10498035?v=3","gravatar_id":"","url":"https://api.github.com/users/axton21","html_url":"https://github.com/axton21","followers_url":"https://api.github.com/users/axton21/followers","following_url":"https://api.github.com/users/axton21/following{/other_user}","gists_url":"https://api.github.com/users/axton21/gists{/gist_id}","starred_url":"https://api.github.com/users/axton21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axton21/subscriptions","organizations_url":"https://api.github.com/users/axton21/orgs","repos_url":"https://api.github.com/users/axton21/repos","events_url":"https://api.github.com/users/axton21/events{/privacy}","received_events_url":"https://api.github.com/users/axton21/received_events","type":"User","site_admin":false},"body":"# What's this PR doing?\r\nThis is also to address an Aurora issue DoSomething/aurora#66 \r\nWe need an endpoint to get users by source.\r\nWe're not sure if this is the right way to go about this, please let me know if any changes are needed.\r\n\r\n# Any involved tickets?\r\n* #179 Seed dummer user with a source\r\n* #180 Endpoint that returns all users with a source","created_at":"2015-08-10T18:11:11Z","updated_at":"2015-08-11T19:46:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5c2a154fa1a10b9bd8439e2393df9fce2b6f739b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DoSomething/northstar/pulls/196/commits","review_comments_url":"https://api.github.com/repos/DoSomething/northstar/pulls/196/comments","review_comment_url":"https://api.github.com/repos/DoSomething/northstar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DoSomething/northstar/issues/196/comments","statuses_url":"https://api.github.com/repos/DoSomething/northstar/statuses/a80baf30fd48f9cb4e7536fdde4db9dc9a8e4f08","head":{"label":"axton21:users-by-source","ref":"users-by-source","sha":"a80baf30fd48f9cb4e7536fdde4db9dc9a8e4f08","user":{"login":"axton21","id":10498035,"avatar_url":"https://avatars.githubusercontent.com/u/10498035?v=3","gravatar_id":"","url":"https://api.github.com/users/axton21","html_url":"https://github.com/axton21","followers_url":"https://api.github.com/users/axton21/followers","following_url":"https://api.github.com/users/axton21/following{/other_user}","gists_url":"https://api.github.com/users/axton21/gists{/gist_id}","starred_url":"https://api.github.com/users/axton21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axton21/subscriptions","organizations_url":"https://api.github.com/users/axton21/orgs","repos_url":"https://api.github.com/users/axton21/repos","events_url":"https://api.github.com/users/axton21/events{/privacy}","received_events_url":"https://api.github.com/users/axton21/received_events","type":"User","site_admin":false},"repo":{"id":38071548,"name":"northstar","full_name":"axton21/northstar","owner":{"login":"axton21","id":10498035,"avatar_url":"https://avatars.githubusercontent.com/u/10498035?v=3","gravatar_id":"","url":"https://api.github.com/users/axton21","html_url":"https://github.com/axton21","followers_url":"https://api.github.com/users/axton21/followers","following_url":"https://api.github.com/users/axton21/following{/other_user}","gists_url":"https://api.github.com/users/axton21/gists{/gist_id}","starred_url":"https://api.github.com/users/axton21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axton21/subscriptions","organizations_url":"https://api.github.com/users/axton21/orgs","repos_url":"https://api.github.com/users/axton21/repos","events_url":"https://api.github.com/users/axton21/events{/privacy}","received_events_url":"https://api.github.com/users/axton21/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/axton21/northstar","description":"The DoSomething.org user & activity API.","fork":true,"url":"https://api.github.com/repos/axton21/northstar","forks_url":"https://api.github.com/repos/axton21/northstar/forks","keys_url":"https://api.github.com/repos/axton21/northstar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/axton21/northstar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/axton21/northstar/teams","hooks_url":"https://api.github.com/repos/axton21/northstar/hooks","issue_events_url":"https://api.github.com/repos/axton21/northstar/issues/events{/number}","events_url":"https://api.github.com/repos/axton21/northstar/events","assignees_url":"https://api.github.com/repos/axton21/northstar/assignees{/user}","branches_url":"https://api.github.com/repos/axton21/northstar/branches{/branch}","tags_url":"https://api.github.com/repos/axton21/northstar/tags","blobs_url":"https://api.github.com/repos/axton21/northstar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/axton21/northstar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/axton21/northstar/git/refs{/sha}","trees_url":"https://api.github.com/repos/axton21/northstar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/axton21/northstar/statuses/{sha}","languages_url":"https://api.github.com/repos/axton21/northstar/languages","stargazers_url":"https://api.github.com/repos/axton21/northstar/stargazers","contributors_url":"https://api.github.com/repos/axton21/northstar/contributors","subscribers_url":"https://api.github.com/repos/axton21/northstar/subscribers","subscription_url":"https://api.github.com/repos/axton21/northstar/subscription","commits_url":"https://api.github.com/repos/axton21/northstar/commits{/sha}","git_commits_url":"https://api.github.com/repos/axton21/northstar/git/commits{/sha}","comments_url":"https://api.github.com/repos/axton21/northstar/comments{/number}","issue_comment_url":"https://api.github.com/repos/axton21/northstar/issues/comments{/number}","contents_url":"https://api.github.com/repos/axton21/northstar/contents/{+path}","compare_url":"https://api.github.com/repos/axton21/northstar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/axton21/northstar/merges","archive_url":"https://api.github.com/repos/axton21/northstar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/axton21/northstar/downloads","issues_url":"https://api.github.com/repos/axton21/northstar/issues{/number}","pulls_url":"https://api.github.com/repos/axton21/northstar/pulls{/number}","milestones_url":"https://api.github.com/repos/axton21/northstar/milestones{/number}","notifications_url":"https://api.github.com/repos/axton21/northstar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/axton21/northstar/labels{/name}","releases_url":"https://api.github.com/repos/axton21/northstar/releases{/id}","created_at":"2015-06-25T20:10:25Z","updated_at":"2015-06-25T20:10:26Z","pushed_at":"2015-08-11T19:17:20Z","git_url":"git://github.com/axton21/northstar.git","ssh_url":"git@github.com:axton21/northstar.git","clone_url":"https://github.com/axton21/northstar.git","svn_url":"https://github.com/axton21/northstar","homepage":"","size":407,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"DoSomething:dev","ref":"dev","sha":"8444f18e79a3a2f3ecd8a32ac1c75220d9d4e933","user":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars.githubusercontent.com/u/731685?v=3","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"repo":{"id":26884886,"name":"northstar","full_name":"DoSomething/northstar","owner":{"login":"DoSomething","id":731685,"avatar_url":"https://avatars.githubusercontent.com/u/731685?v=3","gravatar_id":"","url":"https://api.github.com/users/DoSomething","html_url":"https://github.com/DoSomething","followers_url":"https://api.github.com/users/DoSomething/followers","following_url":"https://api.github.com/users/DoSomething/following{/other_user}","gists_url":"https://api.github.com/users/DoSomething/gists{/gist_id}","starred_url":"https://api.github.com/users/DoSomething/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoSomething/subscriptions","organizations_url":"https://api.github.com/users/DoSomething/orgs","repos_url":"https://api.github.com/users/DoSomething/repos","events_url":"https://api.github.com/users/DoSomething/events{/privacy}","received_events_url":"https://api.github.com/users/DoSomething/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DoSomething/northstar","description":"The DoSomething.org user & activity API.","fork":false,"url":"https://api.github.com/repos/DoSomething/northstar","forks_url":"https://api.github.com/repos/DoSomething/northstar/forks","keys_url":"https://api.github.com/repos/DoSomething/northstar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DoSomething/northstar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DoSomething/northstar/teams","hooks_url":"https://api.github.com/repos/DoSomething/northstar/hooks","issue_events_url":"https://api.github.com/repos/DoSomething/northstar/issues/events{/number}","events_url":"https://api.github.com/repos/DoSomething/northstar/events","assignees_url":"https://api.github.com/repos/DoSomething/northstar/assignees{/user}","branches_url":"https://api.github.com/repos/DoSomething/northstar/branches{/branch}","tags_url":"https://api.github.com/repos/DoSomething/northstar/tags","blobs_url":"https://api.github.com/repos/DoSomething/northstar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DoSomething/northstar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DoSomething/northstar/git/refs{/sha}","trees_url":"https://api.github.com/repos/DoSomething/northstar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DoSomething/northstar/statuses/{sha}","languages_url":"https://api.github.com/repos/DoSomething/northstar/languages","stargazers_url":"https://api.github.com/repos/DoSomething/northstar/stargazers","contributors_url":"https://api.github.com/repos/DoSomething/northstar/contributors","subscribers_url":"https://api.github.com/repos/DoSomething/northstar/subscribers","subscription_url":"https://api.github.com/repos/DoSomething/northstar/subscription","commits_url":"https://api.github.com/repos/DoSomething/northstar/commits{/sha}","git_commits_url":"https://api.github.com/repos/DoSomething/northstar/git/commits{/sha}","comments_url":"https://api.github.com/repos/DoSomething/northstar/comments{/number}","issue_comment_url":"https://api.github.com/repos/DoSomething/northstar/issues/comments{/number}","contents_url":"https://api.github.com/repos/DoSomething/northstar/contents/{+path}","compare_url":"https://api.github.com/repos/DoSomething/northstar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DoSomething/northstar/merges","archive_url":"https://api.github.com/repos/DoSomething/northstar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DoSomething/northstar/downloads","issues_url":"https://api.github.com/repos/DoSomething/northstar/issues{/number}","pulls_url":"https://api.github.com/repos/DoSomething/northstar/pulls{/number}","milestones_url":"https://api.github.com/repos/DoSomething/northstar/milestones{/number}","notifications_url":"https://api.github.com/repos/DoSomething/northstar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DoSomething/northstar/labels{/name}","releases_url":"https://api.github.com/repos/DoSomething/northstar/releases{/id}","created_at":"2014-11-19T22:33:42Z","updated_at":"2015-05-12T17:59:15Z","pushed_at":"2015-08-11T19:17:20Z","git_url":"git://github.com/DoSomething/northstar.git","ssh_url":"git@github.com:DoSomething/northstar.git","clone_url":"https://github.com/DoSomething/northstar.git","svn_url":"https://github.com/DoSomething/northstar","homepage":"","size":1697,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":19,"forks":8,"open_issues":19,"watchers":1,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/DoSomething/northstar/pulls/196"},"html":{"href":"https://github.com/DoSomething/northstar/pull/196"},"issue":{"href":"https://api.github.com/repos/DoSomething/northstar/issues/196"},"comments":{"href":"https://api.github.com/repos/DoSomething/northstar/issues/196/comments"},"review_comments":{"href":"https://api.github.com/repos/DoSomething/northstar/pulls/196/comments"},"review_comment":{"href":"https://api.github.com/repos/DoSomething/northstar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DoSomething/northstar/pulls/196/commits"},"statuses":{"href":"https://api.github.com/repos/DoSomething/northstar/statuses/a80baf30fd48f9cb4e7536fdde4db9dc9a8e4f08"}}}}