{"action":"created","comment":{"url":"https://api.github.com/repos/andela/suyabay/pulls/comments/46834008","id":46834008,"diff_hunk":"@@ -0,0 +1,120 @@\n+<?php\n+\n+namespace Suyabay\\Http\\Controllers;\n+\n+use Suyabay\\Channel;\n+use Suyabay\\Http\\Requests;\n+use Illuminate\\Http\\Request;\n+use Suyabay\\Http\\Controllers\\Controller;\n+\n+class ChannelController extends Controller\n+{\n+    /**\n+     * Display a listing of the resource.\n+     *\n+     * @return \\Illuminate\\Http\\Response\n+     */\n+    public function index ()\n+    {\n+        $channels = Channel::orderBy('id', 'asc')->paginate(10);\n+\n+        return view('dashboard.pages.view_channels', compact('channels'));\n+    }\n+\n+    /**\n+     * Display a listing of the resource.\n+     *\n+     * @return \\Illuminate\\Http\\Response\n+     */\n+    public function createIndex ()\n+    {\n+        return view('dashboard.pages.create_channel');\n+    }\n+\n+    /**\n+     * Show the form for creating a new resource.\n+     *\n+     * @return \\Illuminate\\Http\\Response\n+     */\n+    public function create (Request $request)\n+    {\n+        $channel = Channel::create([\n+            'channel_name'         => $request->name,\n+            'channel_description'  => $request->description,\n+            'subscription_count'   => 0\n+        ]);\n+        if ( $channel )\n+            return 100;\n+    }\n+\n+    /**\n+     * Check if the channel name already exist\n+     *\n+     * @param  $request\n+     * @return bool\n+     */\n+    public function checkChannelExist (Request $request)\n+    {\n+        $check = Channel::where('channel_name', $request->name)->first();\n+        if( $check )","path":"app/Http/Controllers/ChannelController.php","position":59,"original_position":59,"commit_id":"e4935cafb151498552e37c9ad08be4019a55f486","original_commit_id":"e4935cafb151498552e37c9ad08be4019a55f486","user":{"login":"Nitpick-CI","id":12626182,"avatar_url":"https://avatars.githubusercontent.com/u/12626182?v=3","gravatar_id":"","url":"https://api.github.com/users/Nitpick-CI","html_url":"https://github.com/Nitpick-CI","followers_url":"https://api.github.com/users/Nitpick-CI/followers","following_url":"https://api.github.com/users/Nitpick-CI/following{/other_user}","gists_url":"https://api.github.com/users/Nitpick-CI/gists{/gist_id}","starred_url":"https://api.github.com/users/Nitpick-CI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nitpick-CI/subscriptions","organizations_url":"https://api.github.com/users/Nitpick-CI/orgs","repos_url":"https://api.github.com/users/Nitpick-CI/repos","events_url":"https://api.github.com/users/Nitpick-CI/events{/privacy}","received_events_url":"https://api.github.com/users/Nitpick-CI/received_events","type":"User","site_admin":false},"body":"- Expected 1 space after IF keyword; 0 found\n- Inline control structures are not allowed\n- Expected 0 spaces after opening bracket; 1 found\n- Expected 0 spaces before closing bracket; 1 found\n","created_at":"2015-12-07T15:37:08Z","updated_at":"2015-12-07T15:37:08Z","html_url":"https://github.com/andela/suyabay/pull/87#discussion_r46834008","pull_request_url":"https://api.github.com/repos/andela/suyabay/pulls/87","_links":{"self":{"href":"https://api.github.com/repos/andela/suyabay/pulls/comments/46834008"},"html":{"href":"https://github.com/andela/suyabay/pull/87#discussion_r46834008"},"pull_request":{"href":"https://api.github.com/repos/andela/suyabay/pulls/87"}}},"pull_request":{"url":"https://api.github.com/repos/andela/suyabay/pulls/87","id":52859383,"html_url":"https://github.com/andela/suyabay/pull/87","diff_url":"https://github.com/andela/suyabay/pull/87.diff","patch_url":"https://github.com/andela/suyabay/pull/87.patch","issue_url":"https://api.github.com/repos/andela/suyabay/issues/87","number":87,"state":"open","locked":false,"title":"[Suyabay][[#108215326] Manage User and Channel","user":{"login":"andela-iadeniyi","id":7251019,"avatar_url":"https://avatars.githubusercontent.com/u/7251019?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-iadeniyi","html_url":"https://github.com/andela-iadeniyi","followers_url":"https://api.github.com/users/andela-iadeniyi/followers","following_url":"https://api.github.com/users/andela-iadeniyi/following{/other_user}","gists_url":"https://api.github.com/users/andela-iadeniyi/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-iadeniyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-iadeniyi/subscriptions","organizations_url":"https://api.github.com/users/andela-iadeniyi/orgs","repos_url":"https://api.github.com/users/andela-iadeniyi/repos","events_url":"https://api.github.com/users/andela-iadeniyi/events{/privacy}","received_events_url":"https://api.github.com/users/andela-iadeniyi/received_events","type":"User","site_admin":false},"body":"Create and update user.\r\nSend user invitation.\r\nUser role specification.\r\nCreate, update and delete channel.","created_at":"2015-12-07T15:36:57Z","updated_at":"2015-12-07T15:37:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7cc409e8618cf4eb7ebc778fc2138ab71a15b573","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/andela/suyabay/pulls/87/commits","review_comments_url":"https://api.github.com/repos/andela/suyabay/pulls/87/comments","review_comment_url":"https://api.github.com/repos/andela/suyabay/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/suyabay/issues/87/comments","statuses_url":"https://api.github.com/repos/andela/suyabay/statuses/e4935cafb151498552e37c9ad08be4019a55f486","head":{"label":"andela:feature/AdminUser","ref":"feature/AdminUser","sha":"e4935cafb151498552e37c9ad08be4019a55f486","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":41855319,"name":"suyabay","full_name":"andela/suyabay","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/suyabay","description":"Awesome Podcast FM Network for Suya Lovers","fork":false,"url":"https://api.github.com/repos/andela/suyabay","forks_url":"https://api.github.com/repos/andela/suyabay/forks","keys_url":"https://api.github.com/repos/andela/suyabay/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/suyabay/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/suyabay/teams","hooks_url":"https://api.github.com/repos/andela/suyabay/hooks","issue_events_url":"https://api.github.com/repos/andela/suyabay/issues/events{/number}","events_url":"https://api.github.com/repos/andela/suyabay/events","assignees_url":"https://api.github.com/repos/andela/suyabay/assignees{/user}","branches_url":"https://api.github.com/repos/andela/suyabay/branches{/branch}","tags_url":"https://api.github.com/repos/andela/suyabay/tags","blobs_url":"https://api.github.com/repos/andela/suyabay/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/suyabay/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/suyabay/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/suyabay/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/suyabay/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/suyabay/languages","stargazers_url":"https://api.github.com/repos/andela/suyabay/stargazers","contributors_url":"https://api.github.com/repos/andela/suyabay/contributors","subscribers_url":"https://api.github.com/repos/andela/suyabay/subscribers","subscription_url":"https://api.github.com/repos/andela/suyabay/subscription","commits_url":"https://api.github.com/repos/andela/suyabay/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/suyabay/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/suyabay/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/suyabay/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/suyabay/contents/{+path}","compare_url":"https://api.github.com/repos/andela/suyabay/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/suyabay/merges","archive_url":"https://api.github.com/repos/andela/suyabay/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/suyabay/downloads","issues_url":"https://api.github.com/repos/andela/suyabay/issues{/number}","pulls_url":"https://api.github.com/repos/andela/suyabay/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/suyabay/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/suyabay/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/suyabay/labels{/name}","releases_url":"https://api.github.com/repos/andela/suyabay/releases{/id}","created_at":"2015-09-03T11:00:56Z","updated_at":"2015-11-25T11:01:33Z","pushed_at":"2015-12-07T15:36:57Z","git_url":"git://github.com/andela/suyabay.git","ssh_url":"git@github.com:andela/suyabay.git","clone_url":"https://github.com/andela/suyabay.git","svn_url":"https://github.com/andela/suyabay","homepage":"https://suyabay-staging.herokuapp.com","size":15805,"stargazers_count":4,"watchers_count":4,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":4,"default_branch":"staging"}},"base":{"label":"andela:staging","ref":"staging","sha":"7c65ebd9177a69a61ad5a1d67d1bc9242fb49e0d","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":41855319,"name":"suyabay","full_name":"andela/suyabay","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/suyabay","description":"Awesome Podcast FM Network for Suya Lovers","fork":false,"url":"https://api.github.com/repos/andela/suyabay","forks_url":"https://api.github.com/repos/andela/suyabay/forks","keys_url":"https://api.github.com/repos/andela/suyabay/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/suyabay/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/suyabay/teams","hooks_url":"https://api.github.com/repos/andela/suyabay/hooks","issue_events_url":"https://api.github.com/repos/andela/suyabay/issues/events{/number}","events_url":"https://api.github.com/repos/andela/suyabay/events","assignees_url":"https://api.github.com/repos/andela/suyabay/assignees{/user}","branches_url":"https://api.github.com/repos/andela/suyabay/branches{/branch}","tags_url":"https://api.github.com/repos/andela/suyabay/tags","blobs_url":"https://api.github.com/repos/andela/suyabay/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/suyabay/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/suyabay/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/suyabay/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/suyabay/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/suyabay/languages","stargazers_url":"https://api.github.com/repos/andela/suyabay/stargazers","contributors_url":"https://api.github.com/repos/andela/suyabay/contributors","subscribers_url":"https://api.github.com/repos/andela/suyabay/subscribers","subscription_url":"https://api.github.com/repos/andela/suyabay/subscription","commits_url":"https://api.github.com/repos/andela/suyabay/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/suyabay/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/suyabay/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/suyabay/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/suyabay/contents/{+path}","compare_url":"https://api.github.com/repos/andela/suyabay/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/suyabay/merges","archive_url":"https://api.github.com/repos/andela/suyabay/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/suyabay/downloads","issues_url":"https://api.github.com/repos/andela/suyabay/issues{/number}","pulls_url":"https://api.github.com/repos/andela/suyabay/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/suyabay/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/suyabay/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/suyabay/labels{/name}","releases_url":"https://api.github.com/repos/andela/suyabay/releases{/id}","created_at":"2015-09-03T11:00:56Z","updated_at":"2015-11-25T11:01:33Z","pushed_at":"2015-12-07T15:36:57Z","git_url":"git://github.com/andela/suyabay.git","ssh_url":"git@github.com:andela/suyabay.git","clone_url":"https://github.com/andela/suyabay.git","svn_url":"https://github.com/andela/suyabay","homepage":"https://suyabay-staging.herokuapp.com","size":15805,"stargazers_count":4,"watchers_count":4,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":4,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/suyabay/pulls/87"},"html":{"href":"https://github.com/andela/suyabay/pull/87"},"issue":{"href":"https://api.github.com/repos/andela/suyabay/issues/87"},"comments":{"href":"https://api.github.com/repos/andela/suyabay/issues/87/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/suyabay/pulls/87/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/suyabay/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/suyabay/pulls/87/commits"},"statuses":{"href":"https://api.github.com/repos/andela/suyabay/statuses/e4935cafb151498552e37c9ad08be4019a55f486"}}}}