{"action":"created","comment":{"url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/pulls/comments/171124036","pull_request_review_id":99921897,"id":171124036,"diff_hunk":"@@ -1,13 +1,47 @@\n <?php\n+\n namespace App\\Http\\Controllers\\Api;\n \n use Illuminate\\Http\\Response;\n use Illuminate\\Http\\Request;\n+use App\\Http\\Controllers\\Controller;\n+use App\\Http\\Controllers\\Api\\ApiController;\n use App\\Model\\Post;\n use DB;\n \n class PostController extends ApiController\n {\n+\n+    /**\n+     * Get a listing of the posts of user.\n+     *\n+     * @param int $id id of user\n+     *\n+     * @return \\Illuminate\\Http\\Response\n+    */\n+    public function show($id)","path":"app/Http/Controllers/Api/PostController.php","position":22,"original_position":22,"commit_id":"62e2ee5eea7c87f02597b48fe0ddab0f422c74f2","original_commit_id":"62e2ee5eea7c87f02597b48fe0ddab0f422c74f2","user":{"login":"at-xinhnguyen","id":23182736,"avatar_url":"https://avatars1.githubusercontent.com/u/23182736?v=4","gravatar_id":"","url":"https://api.github.com/users/at-xinhnguyen","html_url":"https://github.com/at-xinhnguyen","followers_url":"https://api.github.com/users/at-xinhnguyen/followers","following_url":"https://api.github.com/users/at-xinhnguyen/following{/other_user}","gists_url":"https://api.github.com/users/at-xinhnguyen/gists{/gist_id}","starred_url":"https://api.github.com/users/at-xinhnguyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/at-xinhnguyen/subscriptions","organizations_url":"https://api.github.com/users/at-xinhnguyen/orgs","repos_url":"https://api.github.com/users/at-xinhnguyen/repos","events_url":"https://api.github.com/users/at-xinhnguyen/events{/privacy}","received_events_url":"https://api.github.com/users/at-xinhnguyen/received_events","type":"User","site_admin":false},"body":"nên đặt tên hàm là `getPostsOfUser` chứ show($id) là `endpoint` của api show thông tin của bài post có id là $id rồi.","created_at":"2018-02-28T01:51:10Z","updated_at":"2018-02-28T01:51:10Z","html_url":"https://github.com/AT-PHPIntership/flappy-book/pull/151#discussion_r171124036","pull_request_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/pulls/151","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/AT-PHPIntership/flappy-book/pulls/comments/171124036"},"html":{"href":"https://github.com/AT-PHPIntership/flappy-book/pull/151#discussion_r171124036"},"pull_request":{"href":"https://api.github.com/repos/AT-PHPIntership/flappy-book/pulls/151"}}},"pull_request":{"url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/pulls/151","id":170691139,"html_url":"https://github.com/AT-PHPIntership/flappy-book/pull/151","diff_url":"https://github.com/AT-PHPIntership/flappy-book/pull/151.diff","patch_url":"https://github.com/AT-PHPIntership/flappy-book/pull/151.patch","issue_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/issues/151","number":151,"state":"open","locked":false,"title":"Api get list status of user","user":{"login":"at-trampham","id":33870071,"avatar_url":"https://avatars0.githubusercontent.com/u/33870071?v=4","gravatar_id":"","url":"https://api.github.com/users/at-trampham","html_url":"https://github.com/at-trampham","followers_url":"https://api.github.com/users/at-trampham/followers","following_url":"https://api.github.com/users/at-trampham/following{/other_user}","gists_url":"https://api.github.com/users/at-trampham/gists{/gist_id}","starred_url":"https://api.github.com/users/at-trampham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/at-trampham/subscriptions","organizations_url":"https://api.github.com/users/at-trampham/orgs","repos_url":"https://api.github.com/users/at-trampham/repos","events_url":"https://api.github.com/users/at-trampham/events{/privacy}","received_events_url":"https://api.github.com/users/at-trampham/received_events","type":"User","site_admin":false},"body":"## Description\r\nApi get list posts by user and filter by status of posts table\r\n## Reference Requirements\r\n- Product Backlog ID: PBI-43\r\n- Task ID: #43.2\r\n\r\n## Reference Isuees\r\nNon\r\n\r\n## Migrations\r\nNO\r\n\r\n## Impacted Areas in Application\r\nList general components of the application that this PR will affect:\r\n\r\n-\r\n\r\n## SQL query and `explain`\r\nselect `posts`.`id`, `posts`.`content`, `posts`.`status`, `posts`.`user_id`, `posts`.`created_at`, \r\n           `users`.`name`, `books`.`title`, \r\n           `ratings`.`rating`, `books`.`title`,\r\n           COUNT(likes.id) AS likes ,date_format(`posts`.`created_at`, \"%h:%i:%p %d-%m-%Y\") AS create_date\r\nfrom `posts` \r\ninner join `users` on `posts`.`user_id` = `users`.`id` \r\nleft join `ratings` on `posts`.`id` = `ratings`.`post_id` \r\nleft join `books` on `books`.`id` = `ratings`.`book_id` \r\nleft join `likes` on `posts`.`id` = `likes`.`post_id` \r\nwhere `posts`.`user_id` = 2 \r\ngroup by `posts`.`id`, `ratings`.`id`;\r\n![image](https://user-images.githubusercontent.com/33870071/36529195-2c4ca546-17ea-11e8-94f9-692942510e3f.png)\r\n\r\n\r\n- Refer to [Using Explain with MySQL](https://viblo.asia/p/su-dung-explain-de-toi-uu-cau-lenh-mysql-BYjv44gmvxpV)\r\n","created_at":"2018-02-22T09:05:26Z","updated_at":"2018-02-28T01:51:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"03c833816b00d2642fe649ae563949666b839a5a","assignee":{"login":"at-xinhnguyen","id":23182736,"avatar_url":"https://avatars1.githubusercontent.com/u/23182736?v=4","gravatar_id":"","url":"https://api.github.com/users/at-xinhnguyen","html_url":"https://github.com/at-xinhnguyen","followers_url":"https://api.github.com/users/at-xinhnguyen/followers","following_url":"https://api.github.com/users/at-xinhnguyen/following{/other_user}","gists_url":"https://api.github.com/users/at-xinhnguyen/gists{/gist_id}","starred_url":"https://api.github.com/users/at-xinhnguyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/at-xinhnguyen/subscriptions","organizations_url":"https://api.github.com/users/at-xinhnguyen/orgs","repos_url":"https://api.github.com/users/at-xinhnguyen/repos","events_url":"https://api.github.com/users/at-xinhnguyen/events{/privacy}","received_events_url":"https://api.github.com/users/at-xinhnguyen/received_events","type":"User","site_admin":false},"assignees":[{"login":"at-xinhnguyen","id":23182736,"avatar_url":"https://avatars1.githubusercontent.com/u/23182736?v=4","gravatar_id":"","url":"https://api.github.com/users/at-xinhnguyen","html_url":"https://github.com/at-xinhnguyen","followers_url":"https://api.github.com/users/at-xinhnguyen/followers","following_url":"https://api.github.com/users/at-xinhnguyen/following{/other_user}","gists_url":"https://api.github.com/users/at-xinhnguyen/gists{/gist_id}","starred_url":"https://api.github.com/users/at-xinhnguyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/at-xinhnguyen/subscriptions","organizations_url":"https://api.github.com/users/at-xinhnguyen/orgs","repos_url":"https://api.github.com/users/at-xinhnguyen/repos","events_url":"https://api.github.com/users/at-xinhnguyen/events{/privacy}","received_events_url":"https://api.github.com/users/at-xinhnguyen/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":787378093,"url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/labels/sprint-3","name":"sprint-3","color":"cc317c","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/pulls/151/commits","review_comments_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/pulls/151/comments","review_comment_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/issues/151/comments","statuses_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/statuses/62e2ee5eea7c87f02597b48fe0ddab0f422c74f2","head":{"label":"AT-PHPIntership:implement_api_get_list_status_of_user","ref":"implement_api_get_list_status_of_user","sha":"62e2ee5eea7c87f02597b48fe0ddab0f422c74f2","user":{"login":"AT-PHPIntership","id":17865237,"avatar_url":"https://avatars1.githubusercontent.com/u/17865237?v=4","gravatar_id":"","url":"https://api.github.com/users/AT-PHPIntership","html_url":"https://github.com/AT-PHPIntership","followers_url":"https://api.github.com/users/AT-PHPIntership/followers","following_url":"https://api.github.com/users/AT-PHPIntership/following{/other_user}","gists_url":"https://api.github.com/users/AT-PHPIntership/gists{/gist_id}","starred_url":"https://api.github.com/users/AT-PHPIntership/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AT-PHPIntership/subscriptions","organizations_url":"https://api.github.com/users/AT-PHPIntership/orgs","repos_url":"https://api.github.com/users/AT-PHPIntership/repos","events_url":"https://api.github.com/users/AT-PHPIntership/events{/privacy}","received_events_url":"https://api.github.com/users/AT-PHPIntership/received_events","type":"Organization","site_admin":false},"repo":{"id":115322807,"name":"flappy-book","full_name":"AT-PHPIntership/flappy-book","owner":{"login":"AT-PHPIntership","id":17865237,"avatar_url":"https://avatars1.githubusercontent.com/u/17865237?v=4","gravatar_id":"","url":"https://api.github.com/users/AT-PHPIntership","html_url":"https://github.com/AT-PHPIntership","followers_url":"https://api.github.com/users/AT-PHPIntership/followers","following_url":"https://api.github.com/users/AT-PHPIntership/following{/other_user}","gists_url":"https://api.github.com/users/AT-PHPIntership/gists{/gist_id}","starred_url":"https://api.github.com/users/AT-PHPIntership/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AT-PHPIntership/subscriptions","organizations_url":"https://api.github.com/users/AT-PHPIntership/orgs","repos_url":"https://api.github.com/users/AT-PHPIntership/repos","events_url":"https://api.github.com/users/AT-PHPIntership/events{/privacy}","received_events_url":"https://api.github.com/users/AT-PHPIntership/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AT-PHPIntership/flappy-book","description":null,"fork":false,"url":"https://api.github.com/repos/AT-PHPIntership/flappy-book","forks_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/forks","keys_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/teams","hooks_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/hooks","issue_events_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/issues/events{/number}","events_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/events","assignees_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/assignees{/user}","branches_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/branches{/branch}","tags_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/tags","blobs_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/git/refs{/sha}","trees_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/statuses/{sha}","languages_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/languages","stargazers_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/stargazers","contributors_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/contributors","subscribers_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/subscribers","subscription_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/subscription","commits_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/commits{/sha}","git_commits_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/git/commits{/sha}","comments_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/comments{/number}","issue_comment_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/issues/comments{/number}","contents_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/contents/{+path}","compare_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/merges","archive_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/downloads","issues_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/issues{/number}","pulls_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/pulls{/number}","milestones_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/milestones{/number}","notifications_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/labels{/name}","releases_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/releases{/id}","deployments_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/deployments","created_at":"2017-12-25T08:49:58Z","updated_at":"2017-12-25T08:50:35Z","pushed_at":"2018-02-27T16:15:20Z","git_url":"git://github.com/AT-PHPIntership/flappy-book.git","ssh_url":"git@github.com:AT-PHPIntership/flappy-book.git","clone_url":"https://github.com/AT-PHPIntership/flappy-book.git","svn_url":"https://github.com/AT-PHPIntership/flappy-book","homepage":null,"size":1772,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":21,"license":null,"forks":1,"open_issues":21,"watchers":0,"default_branch":"master"}},"base":{"label":"AT-PHPIntership:master","ref":"master","sha":"5c664a005e8e14e986aed825ecfdbaeb3fc5502a","user":{"login":"AT-PHPIntership","id":17865237,"avatar_url":"https://avatars1.githubusercontent.com/u/17865237?v=4","gravatar_id":"","url":"https://api.github.com/users/AT-PHPIntership","html_url":"https://github.com/AT-PHPIntership","followers_url":"https://api.github.com/users/AT-PHPIntership/followers","following_url":"https://api.github.com/users/AT-PHPIntership/following{/other_user}","gists_url":"https://api.github.com/users/AT-PHPIntership/gists{/gist_id}","starred_url":"https://api.github.com/users/AT-PHPIntership/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AT-PHPIntership/subscriptions","organizations_url":"https://api.github.com/users/AT-PHPIntership/orgs","repos_url":"https://api.github.com/users/AT-PHPIntership/repos","events_url":"https://api.github.com/users/AT-PHPIntership/events{/privacy}","received_events_url":"https://api.github.com/users/AT-PHPIntership/received_events","type":"Organization","site_admin":false},"repo":{"id":115322807,"name":"flappy-book","full_name":"AT-PHPIntership/flappy-book","owner":{"login":"AT-PHPIntership","id":17865237,"avatar_url":"https://avatars1.githubusercontent.com/u/17865237?v=4","gravatar_id":"","url":"https://api.github.com/users/AT-PHPIntership","html_url":"https://github.com/AT-PHPIntership","followers_url":"https://api.github.com/users/AT-PHPIntership/followers","following_url":"https://api.github.com/users/AT-PHPIntership/following{/other_user}","gists_url":"https://api.github.com/users/AT-PHPIntership/gists{/gist_id}","starred_url":"https://api.github.com/users/AT-PHPIntership/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AT-PHPIntership/subscriptions","organizations_url":"https://api.github.com/users/AT-PHPIntership/orgs","repos_url":"https://api.github.com/users/AT-PHPIntership/repos","events_url":"https://api.github.com/users/AT-PHPIntership/events{/privacy}","received_events_url":"https://api.github.com/users/AT-PHPIntership/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AT-PHPIntership/flappy-book","description":null,"fork":false,"url":"https://api.github.com/repos/AT-PHPIntership/flappy-book","forks_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/forks","keys_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/teams","hooks_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/hooks","issue_events_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/issues/events{/number}","events_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/events","assignees_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/assignees{/user}","branches_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/branches{/branch}","tags_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/tags","blobs_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/git/refs{/sha}","trees_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/statuses/{sha}","languages_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/languages","stargazers_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/stargazers","contributors_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/contributors","subscribers_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/subscribers","subscription_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/subscription","commits_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/commits{/sha}","git_commits_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/git/commits{/sha}","comments_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/comments{/number}","issue_comment_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/issues/comments{/number}","contents_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/contents/{+path}","compare_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/merges","archive_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/downloads","issues_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/issues{/number}","pulls_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/pulls{/number}","milestones_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/milestones{/number}","notifications_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/labels{/name}","releases_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/releases{/id}","deployments_url":"https://api.github.com/repos/AT-PHPIntership/flappy-book/deployments","created_at":"2017-12-25T08:49:58Z","updated_at":"2017-12-25T08:50:35Z","pushed_at":"2018-02-27T16:15:20Z","git_url":"git://github.com/AT-PHPIntership/flappy-book.git","ssh_url":"git@github.com:AT-PHPIntership/flappy-book.git","clone_url":"https://github.com/AT-PHPIntership/flappy-book.git","svn_url":"https://github.com/AT-PHPIntership/flappy-book","homepage":null,"size":1772,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":21,"license":null,"forks":1,"open_issues":21,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AT-PHPIntership/flappy-book/pulls/151"},"html":{"href":"https://github.com/AT-PHPIntership/flappy-book/pull/151"},"issue":{"href":"https://api.github.com/repos/AT-PHPIntership/flappy-book/issues/151"},"comments":{"href":"https://api.github.com/repos/AT-PHPIntership/flappy-book/issues/151/comments"},"review_comments":{"href":"https://api.github.com/repos/AT-PHPIntership/flappy-book/pulls/151/comments"},"review_comment":{"href":"https://api.github.com/repos/AT-PHPIntership/flappy-book/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AT-PHPIntership/flappy-book/pulls/151/commits"},"statuses":{"href":"https://api.github.com/repos/AT-PHPIntership/flappy-book/statuses/62e2ee5eea7c87f02597b48fe0ddab0f422c74f2"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"at-xinhnguyen"}}