{"action":"created","comment":{"url":"https://api.github.com/repos/opengovfoundation/madison/pulls/comments/61590415","id":61590415,"diff_hunk":"@@ -0,0 +1,32 @@\n+<?php\n+\n+namespace App\\Http\\Requests;\n+\n+use App\\Http\\Requests\\Request;\n+use App\\Models\\Role;\n+use Auth;\n+\n+class DestroyPageRequest extends Request\n+{\n+    /**\n+     * Determine if the user is authorized to make this request.\n+     *\n+     * @return bool\n+     */\n+    public function authorize()\n+    {\n+        $user = Auth::user();\n+        return $user && $user->hasRole(Role::ROLE_ADMIN);","path":"app/Http/Requests/DestroyPageRequest.php","position":19,"original_position":19,"commit_id":"a056d9186a68f00210516a5e79e481f67e4b3298","original_commit_id":"24c712932a1657fe7110c7594885b6ef474e3ecd","user":{"login":"krues8dr","id":127904,"avatar_url":"https://avatars.githubusercontent.com/u/127904?v=3","gravatar_id":"","url":"https://api.github.com/users/krues8dr","html_url":"https://github.com/krues8dr","followers_url":"https://api.github.com/users/krues8dr/followers","following_url":"https://api.github.com/users/krues8dr/following{/other_user}","gists_url":"https://api.github.com/users/krues8dr/gists{/gist_id}","starred_url":"https://api.github.com/users/krues8dr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krues8dr/subscriptions","organizations_url":"https://api.github.com/users/krues8dr/orgs","repos_url":"https://api.github.com/users/krues8dr/repos","events_url":"https://api.github.com/users/krues8dr/events{/privacy}","received_events_url":"https://api.github.com/users/krues8dr/received_events","type":"User","site_admin":false},"body":"Why can't you create an AuthorizedRequest class that extends Request and defines authorize() and use that as a base for all of these other Request objects that use it?  Seems silly to copy and paste that code over and over.","created_at":"2016-04-29T14:55:53Z","updated_at":"2016-04-29T14:55:53Z","html_url":"https://github.com/opengovfoundation/madison/pull/940#discussion_r61590415","pull_request_url":"https://api.github.com/repos/opengovfoundation/madison/pulls/940","_links":{"self":{"href":"https://api.github.com/repos/opengovfoundation/madison/pulls/comments/61590415"},"html":{"href":"https://github.com/opengovfoundation/madison/pull/940#discussion_r61590415"},"pull_request":{"href":"https://api.github.com/repos/opengovfoundation/madison/pulls/940"}}},"pull_request":{"url":"https://api.github.com/repos/opengovfoundation/madison/pulls/940","id":67774311,"html_url":"https://github.com/opengovfoundation/madison/pull/940","diff_url":"https://github.com/opengovfoundation/madison/pull/940.diff","patch_url":"https://github.com/opengovfoundation/madison/pull/940.patch","issue_url":"https://api.github.com/repos/opengovfoundation/madison/issues/940","number":940,"state":"open","locked":false,"title":"Issue 679 - Custom content pages","user":{"login":"sethetter","id":655500,"avatar_url":"https://avatars.githubusercontent.com/u/655500?v=3","gravatar_id":"","url":"https://api.github.com/users/sethetter","html_url":"https://github.com/sethetter","followers_url":"https://api.github.com/users/sethetter/followers","following_url":"https://api.github.com/users/sethetter/following{/other_user}","gists_url":"https://api.github.com/users/sethetter/gists{/gist_id}","starred_url":"https://api.github.com/users/sethetter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethetter/subscriptions","organizations_url":"https://api.github.com/users/sethetter/orgs","repos_url":"https://api.github.com/users/sethetter/repos","events_url":"https://api.github.com/users/sethetter/events{/privacy}","received_events_url":"https://api.github.com/users/sethetter/received_events","type":"User","site_admin":false},"body":"New models: **Page**, and **PageContent**.\r\n\r\nPages loaded from the database on app load, using future states from [ui-router-extras](https://christopherthielen.github.io/ui-router-extras/#/home) to dynamically create angular routes for each page.\r\n\r\nAdmin interface for creating / editing pages as well.\r\n\r\n@krues8dr @doshitan ","created_at":"2016-04-25T19:27:39Z","updated_at":"2016-04-29T14:55:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d5ffcbf702299ea8e465737bba3c31b45bf05b7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/opengovfoundation/madison/pulls/940/commits","review_comments_url":"https://api.github.com/repos/opengovfoundation/madison/pulls/940/comments","review_comment_url":"https://api.github.com/repos/opengovfoundation/madison/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opengovfoundation/madison/issues/940/comments","statuses_url":"https://api.github.com/repos/opengovfoundation/madison/statuses/a056d9186a68f00210516a5e79e481f67e4b3298","head":{"label":"opengovfoundation:issue-679","ref":"issue-679","sha":"a056d9186a68f00210516a5e79e481f67e4b3298","user":{"login":"opengovfoundation","id":2090211,"avatar_url":"https://avatars.githubusercontent.com/u/2090211?v=3","gravatar_id":"","url":"https://api.github.com/users/opengovfoundation","html_url":"https://github.com/opengovfoundation","followers_url":"https://api.github.com/users/opengovfoundation/followers","following_url":"https://api.github.com/users/opengovfoundation/following{/other_user}","gists_url":"https://api.github.com/users/opengovfoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/opengovfoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opengovfoundation/subscriptions","organizations_url":"https://api.github.com/users/opengovfoundation/orgs","repos_url":"https://api.github.com/users/opengovfoundation/repos","events_url":"https://api.github.com/users/opengovfoundation/events{/privacy}","received_events_url":"https://api.github.com/users/opengovfoundation/received_events","type":"Organization","site_admin":false},"repo":{"id":9036469,"name":"madison","full_name":"opengovfoundation/madison","owner":{"login":"opengovfoundation","id":2090211,"avatar_url":"https://avatars.githubusercontent.com/u/2090211?v=3","gravatar_id":"","url":"https://api.github.com/users/opengovfoundation","html_url":"https://github.com/opengovfoundation","followers_url":"https://api.github.com/users/opengovfoundation/followers","following_url":"https://api.github.com/users/opengovfoundation/following{/other_user}","gists_url":"https://api.github.com/users/opengovfoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/opengovfoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opengovfoundation/subscriptions","organizations_url":"https://api.github.com/users/opengovfoundation/orgs","repos_url":"https://api.github.com/users/opengovfoundation/repos","events_url":"https://api.github.com/users/opengovfoundation/events{/privacy}","received_events_url":"https://api.github.com/users/opengovfoundation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opengovfoundation/madison","description":"Madison 2.0","fork":false,"url":"https://api.github.com/repos/opengovfoundation/madison","forks_url":"https://api.github.com/repos/opengovfoundation/madison/forks","keys_url":"https://api.github.com/repos/opengovfoundation/madison/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opengovfoundation/madison/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opengovfoundation/madison/teams","hooks_url":"https://api.github.com/repos/opengovfoundation/madison/hooks","issue_events_url":"https://api.github.com/repos/opengovfoundation/madison/issues/events{/number}","events_url":"https://api.github.com/repos/opengovfoundation/madison/events","assignees_url":"https://api.github.com/repos/opengovfoundation/madison/assignees{/user}","branches_url":"https://api.github.com/repos/opengovfoundation/madison/branches{/branch}","tags_url":"https://api.github.com/repos/opengovfoundation/madison/tags","blobs_url":"https://api.github.com/repos/opengovfoundation/madison/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opengovfoundation/madison/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opengovfoundation/madison/git/refs{/sha}","trees_url":"https://api.github.com/repos/opengovfoundation/madison/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opengovfoundation/madison/statuses/{sha}","languages_url":"https://api.github.com/repos/opengovfoundation/madison/languages","stargazers_url":"https://api.github.com/repos/opengovfoundation/madison/stargazers","contributors_url":"https://api.github.com/repos/opengovfoundation/madison/contributors","subscribers_url":"https://api.github.com/repos/opengovfoundation/madison/subscribers","subscription_url":"https://api.github.com/repos/opengovfoundation/madison/subscription","commits_url":"https://api.github.com/repos/opengovfoundation/madison/commits{/sha}","git_commits_url":"https://api.github.com/repos/opengovfoundation/madison/git/commits{/sha}","comments_url":"https://api.github.com/repos/opengovfoundation/madison/comments{/number}","issue_comment_url":"https://api.github.com/repos/opengovfoundation/madison/issues/comments{/number}","contents_url":"https://api.github.com/repos/opengovfoundation/madison/contents/{+path}","compare_url":"https://api.github.com/repos/opengovfoundation/madison/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opengovfoundation/madison/merges","archive_url":"https://api.github.com/repos/opengovfoundation/madison/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opengovfoundation/madison/downloads","issues_url":"https://api.github.com/repos/opengovfoundation/madison/issues{/number}","pulls_url":"https://api.github.com/repos/opengovfoundation/madison/pulls{/number}","milestones_url":"https://api.github.com/repos/opengovfoundation/madison/milestones{/number}","notifications_url":"https://api.github.com/repos/opengovfoundation/madison/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opengovfoundation/madison/labels{/name}","releases_url":"https://api.github.com/repos/opengovfoundation/madison/releases{/id}","deployments_url":"https://api.github.com/repos/opengovfoundation/madison/deployments","created_at":"2013-03-26T17:49:22Z","updated_at":"2016-04-29T03:36:08Z","pushed_at":"2016-04-28T21:13:56Z","git_url":"git://github.com/opengovfoundation/madison.git","ssh_url":"git@github.com:opengovfoundation/madison.git","clone_url":"https://github.com/opengovfoundation/madison.git","svn_url":"https://github.com/opengovfoundation/madison","homepage":null,"size":141344,"stargazers_count":189,"watchers_count":189,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":59,"mirror_url":null,"open_issues_count":204,"forks":59,"open_issues":204,"watchers":189,"default_branch":"master"}},"base":{"label":"opengovfoundation:dev","ref":"dev","sha":"0a495e1c7e588619969fc98ac8174364a8d08934","user":{"login":"opengovfoundation","id":2090211,"avatar_url":"https://avatars.githubusercontent.com/u/2090211?v=3","gravatar_id":"","url":"https://api.github.com/users/opengovfoundation","html_url":"https://github.com/opengovfoundation","followers_url":"https://api.github.com/users/opengovfoundation/followers","following_url":"https://api.github.com/users/opengovfoundation/following{/other_user}","gists_url":"https://api.github.com/users/opengovfoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/opengovfoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opengovfoundation/subscriptions","organizations_url":"https://api.github.com/users/opengovfoundation/orgs","repos_url":"https://api.github.com/users/opengovfoundation/repos","events_url":"https://api.github.com/users/opengovfoundation/events{/privacy}","received_events_url":"https://api.github.com/users/opengovfoundation/received_events","type":"Organization","site_admin":false},"repo":{"id":9036469,"name":"madison","full_name":"opengovfoundation/madison","owner":{"login":"opengovfoundation","id":2090211,"avatar_url":"https://avatars.githubusercontent.com/u/2090211?v=3","gravatar_id":"","url":"https://api.github.com/users/opengovfoundation","html_url":"https://github.com/opengovfoundation","followers_url":"https://api.github.com/users/opengovfoundation/followers","following_url":"https://api.github.com/users/opengovfoundation/following{/other_user}","gists_url":"https://api.github.com/users/opengovfoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/opengovfoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opengovfoundation/subscriptions","organizations_url":"https://api.github.com/users/opengovfoundation/orgs","repos_url":"https://api.github.com/users/opengovfoundation/repos","events_url":"https://api.github.com/users/opengovfoundation/events{/privacy}","received_events_url":"https://api.github.com/users/opengovfoundation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opengovfoundation/madison","description":"Madison 2.0","fork":false,"url":"https://api.github.com/repos/opengovfoundation/madison","forks_url":"https://api.github.com/repos/opengovfoundation/madison/forks","keys_url":"https://api.github.com/repos/opengovfoundation/madison/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opengovfoundation/madison/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opengovfoundation/madison/teams","hooks_url":"https://api.github.com/repos/opengovfoundation/madison/hooks","issue_events_url":"https://api.github.com/repos/opengovfoundation/madison/issues/events{/number}","events_url":"https://api.github.com/repos/opengovfoundation/madison/events","assignees_url":"https://api.github.com/repos/opengovfoundation/madison/assignees{/user}","branches_url":"https://api.github.com/repos/opengovfoundation/madison/branches{/branch}","tags_url":"https://api.github.com/repos/opengovfoundation/madison/tags","blobs_url":"https://api.github.com/repos/opengovfoundation/madison/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opengovfoundation/madison/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opengovfoundation/madison/git/refs{/sha}","trees_url":"https://api.github.com/repos/opengovfoundation/madison/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opengovfoundation/madison/statuses/{sha}","languages_url":"https://api.github.com/repos/opengovfoundation/madison/languages","stargazers_url":"https://api.github.com/repos/opengovfoundation/madison/stargazers","contributors_url":"https://api.github.com/repos/opengovfoundation/madison/contributors","subscribers_url":"https://api.github.com/repos/opengovfoundation/madison/subscribers","subscription_url":"https://api.github.com/repos/opengovfoundation/madison/subscription","commits_url":"https://api.github.com/repos/opengovfoundation/madison/commits{/sha}","git_commits_url":"https://api.github.com/repos/opengovfoundation/madison/git/commits{/sha}","comments_url":"https://api.github.com/repos/opengovfoundation/madison/comments{/number}","issue_comment_url":"https://api.github.com/repos/opengovfoundation/madison/issues/comments{/number}","contents_url":"https://api.github.com/repos/opengovfoundation/madison/contents/{+path}","compare_url":"https://api.github.com/repos/opengovfoundation/madison/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opengovfoundation/madison/merges","archive_url":"https://api.github.com/repos/opengovfoundation/madison/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opengovfoundation/madison/downloads","issues_url":"https://api.github.com/repos/opengovfoundation/madison/issues{/number}","pulls_url":"https://api.github.com/repos/opengovfoundation/madison/pulls{/number}","milestones_url":"https://api.github.com/repos/opengovfoundation/madison/milestones{/number}","notifications_url":"https://api.github.com/repos/opengovfoundation/madison/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opengovfoundation/madison/labels{/name}","releases_url":"https://api.github.com/repos/opengovfoundation/madison/releases{/id}","deployments_url":"https://api.github.com/repos/opengovfoundation/madison/deployments","created_at":"2013-03-26T17:49:22Z","updated_at":"2016-04-29T03:36:08Z","pushed_at":"2016-04-28T21:13:56Z","git_url":"git://github.com/opengovfoundation/madison.git","ssh_url":"git@github.com:opengovfoundation/madison.git","clone_url":"https://github.com/opengovfoundation/madison.git","svn_url":"https://github.com/opengovfoundation/madison","homepage":null,"size":141344,"stargazers_count":189,"watchers_count":189,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":59,"mirror_url":null,"open_issues_count":204,"forks":59,"open_issues":204,"watchers":189,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opengovfoundation/madison/pulls/940"},"html":{"href":"https://github.com/opengovfoundation/madison/pull/940"},"issue":{"href":"https://api.github.com/repos/opengovfoundation/madison/issues/940"},"comments":{"href":"https://api.github.com/repos/opengovfoundation/madison/issues/940/comments"},"review_comments":{"href":"https://api.github.com/repos/opengovfoundation/madison/pulls/940/comments"},"review_comment":{"href":"https://api.github.com/repos/opengovfoundation/madison/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opengovfoundation/madison/pulls/940/commits"},"statuses":{"href":"https://api.github.com/repos/opengovfoundation/madison/statuses/a056d9186a68f00210516a5e79e481f67e4b3298"}}}}