{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/fels_208/pulls/comments/87736762","pull_request_review_id":8336195,"id":87736762,"diff_hunk":"@@ -0,0 +1,99 @@\n+<?php\n+\n+namespace App\\Http\\Controllers\\Web;\n+\n+use Auth;\n+use Hash;\n+use App\\Models\\User;\n+use Illuminate\\Http\\Request;\n+use App\\Http\\Controllers\\Controller;\n+use App\\Http\\Requests\\UpdateProfile;\n+use Illuminate\\Support\\Facades\\Input;\n+use App\\Http\\Requests\\CheckPassword;\n+\n+class ProfilesController extends Controller\n+{\n+    public function __construct()\n+    {\n+        parent::__construct();\n+        $this->viewData['title'] = trans('users.user-profile');\n+    }\n+\n+    /**\n+     * Display the specified resource.\n+     *\n+     * @param  int  $id\n+     * @return \\Illuminate\\Http\\Response\n+     */\n+    public function show($id)\n+    {\n+        $this->viewData['user'] = User::find($id);\n+\n+        return view('frontend.users.profile', ['title' => trans('users.show-profile')], $this->viewData);\n+    }\n+\n+    /**\n+     * Show the form for editing the specified resource.\n+     *\n+     * @param  int  $id\n+     * @return \\Illuminate\\Http\\Response\n+     */\n+    public function edit($id)\n+    {\n+        $user = User::findOrFail($id);\n+\n+        if ($user->isCurrent()) {\n+            $this->viewData['user'] = $user;\n+\n+            return view('frontend.users.update', ['title' => trans('users.update-profile')], $this->viewData);\n+        }\n+\n+        return redirect()->action('Web\\ProfilesController@show', ['id' => $id])->withErrors(trans('users.permission'));\n+    }\n+\n+    /**\n+     * Update the specified resource in storage.\n+     *\n+     * @param  \\Illuminate\\Http\\Request  $request\n+     * @param  int  $id\n+     * @return \\Illuminate\\Http\\Response\n+     */\n+    public function update(UpdateProfile $request, $id)\n+    {\n+        $user = User::findOrFail($id);\n+        $user->name = $request->input('name');\n+        $user->email = $request->input('email');\n+        $path = 'upload/avatar/';\n+        $avatar = upload('image', $path);\n+\n+        if (!$avatar) {\n+            $user->avatar = $user->avatar;\n+        } else {\n+            $user->avatar = $path . $avatar;","path":"app/Http/Controllers/Web/ProfilesController.php","position":72,"original_position":72,"commit_id":"c1d32571c277da0f69ee58ca4e97cb0620744083","original_commit_id":"c1d32571c277da0f69ee58ca4e97cb0620744083","user":{"login":"NgTheThao","id":11207197,"avatar_url":"https://avatars.githubusercontent.com/u/11207197?v=3","gravatar_id":"","url":"https://api.github.com/users/NgTheThao","html_url":"https://github.com/NgTheThao","followers_url":"https://api.github.com/users/NgTheThao/followers","following_url":"https://api.github.com/users/NgTheThao/following{/other_user}","gists_url":"https://api.github.com/users/NgTheThao/gists{/gist_id}","starred_url":"https://api.github.com/users/NgTheThao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NgTheThao/subscriptions","organizations_url":"https://api.github.com/users/NgTheThao/orgs","repos_url":"https://api.github.com/users/NgTheThao/repos","events_url":"https://api.github.com/users/NgTheThao/events{/privacy}","received_events_url":"https://api.github.com/users/NgTheThao/received_events","type":"User","site_admin":false},"body":"avatar của user chỉ cần lưu name của image thôi, lúc lấy ra thì gắn đường dẫn vào sau","created_at":"2016-11-14T04:20:14Z","updated_at":"2016-11-14T04:20:14Z","html_url":"https://github.com/framgia/fels_208/pull/18#discussion_r87736762","pull_request_url":"https://api.github.com/repos/framgia/fels_208/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_208/pulls/comments/87736762"},"html":{"href":"https://github.com/framgia/fels_208/pull/18#discussion_r87736762"},"pull_request":{"href":"https://api.github.com/repos/framgia/fels_208/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/fels_208/pulls/18","id":93295741,"html_url":"https://github.com/framgia/fels_208/pull/18","diff_url":"https://github.com/framgia/fels_208/pull/18.diff","patch_url":"https://github.com/framgia/fels_208/pull/18.patch","issue_url":"https://api.github.com/repos/framgia/fels_208/issues/18","number":18,"state":"open","locked":false,"title":"update UserProfile","user":{"login":"ngovanhieu","id":22955202,"avatar_url":"https://avatars.githubusercontent.com/u/22955202?v=3","gravatar_id":"","url":"https://api.github.com/users/ngovanhieu","html_url":"https://github.com/ngovanhieu","followers_url":"https://api.github.com/users/ngovanhieu/followers","following_url":"https://api.github.com/users/ngovanhieu/following{/other_user}","gists_url":"https://api.github.com/users/ngovanhieu/gists{/gist_id}","starred_url":"https://api.github.com/users/ngovanhieu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngovanhieu/subscriptions","organizations_url":"https://api.github.com/users/ngovanhieu/orgs","repos_url":"https://api.github.com/users/ngovanhieu/repos","events_url":"https://api.github.com/users/ngovanhieu/events{/privacy}","received_events_url":"https://api.github.com/users/ngovanhieu/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-11T08:27:51Z","updated_at":"2016-11-14T04:20:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ddafc4d3e81f2c11b6c942a20a0bce8b77ee0c87","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/fels_208/pulls/18/commits","review_comments_url":"https://api.github.com/repos/framgia/fels_208/pulls/18/comments","review_comment_url":"https://api.github.com/repos/framgia/fels_208/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/fels_208/issues/18/comments","statuses_url":"https://api.github.com/repos/framgia/fels_208/statuses/c1d32571c277da0f69ee58ca4e97cb0620744083","head":{"label":"ngovanhieu:newUpdateProfile","ref":"newUpdateProfile","sha":"c1d32571c277da0f69ee58ca4e97cb0620744083","user":{"login":"ngovanhieu","id":22955202,"avatar_url":"https://avatars.githubusercontent.com/u/22955202?v=3","gravatar_id":"","url":"https://api.github.com/users/ngovanhieu","html_url":"https://github.com/ngovanhieu","followers_url":"https://api.github.com/users/ngovanhieu/followers","following_url":"https://api.github.com/users/ngovanhieu/following{/other_user}","gists_url":"https://api.github.com/users/ngovanhieu/gists{/gist_id}","starred_url":"https://api.github.com/users/ngovanhieu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngovanhieu/subscriptions","organizations_url":"https://api.github.com/users/ngovanhieu/orgs","repos_url":"https://api.github.com/users/ngovanhieu/repos","events_url":"https://api.github.com/users/ngovanhieu/events{/privacy}","received_events_url":"https://api.github.com/users/ngovanhieu/received_events","type":"User","site_admin":false},"repo":{"id":73056104,"name":"fels_208","full_name":"ngovanhieu/fels_208","owner":{"login":"ngovanhieu","id":22955202,"avatar_url":"https://avatars.githubusercontent.com/u/22955202?v=3","gravatar_id":"","url":"https://api.github.com/users/ngovanhieu","html_url":"https://github.com/ngovanhieu","followers_url":"https://api.github.com/users/ngovanhieu/followers","following_url":"https://api.github.com/users/ngovanhieu/following{/other_user}","gists_url":"https://api.github.com/users/ngovanhieu/gists{/gist_id}","starred_url":"https://api.github.com/users/ngovanhieu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngovanhieu/subscriptions","organizations_url":"https://api.github.com/users/ngovanhieu/orgs","repos_url":"https://api.github.com/users/ngovanhieu/repos","events_url":"https://api.github.com/users/ngovanhieu/events{/privacy}","received_events_url":"https://api.github.com/users/ngovanhieu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ngovanhieu/fels_208","description":"Framgia E-Learning System (training - PHP)","fork":true,"url":"https://api.github.com/repos/ngovanhieu/fels_208","forks_url":"https://api.github.com/repos/ngovanhieu/fels_208/forks","keys_url":"https://api.github.com/repos/ngovanhieu/fels_208/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ngovanhieu/fels_208/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ngovanhieu/fels_208/teams","hooks_url":"https://api.github.com/repos/ngovanhieu/fels_208/hooks","issue_events_url":"https://api.github.com/repos/ngovanhieu/fels_208/issues/events{/number}","events_url":"https://api.github.com/repos/ngovanhieu/fels_208/events","assignees_url":"https://api.github.com/repos/ngovanhieu/fels_208/assignees{/user}","branches_url":"https://api.github.com/repos/ngovanhieu/fels_208/branches{/branch}","tags_url":"https://api.github.com/repos/ngovanhieu/fels_208/tags","blobs_url":"https://api.github.com/repos/ngovanhieu/fels_208/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ngovanhieu/fels_208/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ngovanhieu/fels_208/git/refs{/sha}","trees_url":"https://api.github.com/repos/ngovanhieu/fels_208/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ngovanhieu/fels_208/statuses/{sha}","languages_url":"https://api.github.com/repos/ngovanhieu/fels_208/languages","stargazers_url":"https://api.github.com/repos/ngovanhieu/fels_208/stargazers","contributors_url":"https://api.github.com/repos/ngovanhieu/fels_208/contributors","subscribers_url":"https://api.github.com/repos/ngovanhieu/fels_208/subscribers","subscription_url":"https://api.github.com/repos/ngovanhieu/fels_208/subscription","commits_url":"https://api.github.com/repos/ngovanhieu/fels_208/commits{/sha}","git_commits_url":"https://api.github.com/repos/ngovanhieu/fels_208/git/commits{/sha}","comments_url":"https://api.github.com/repos/ngovanhieu/fels_208/comments{/number}","issue_comment_url":"https://api.github.com/repos/ngovanhieu/fels_208/issues/comments{/number}","contents_url":"https://api.github.com/repos/ngovanhieu/fels_208/contents/{+path}","compare_url":"https://api.github.com/repos/ngovanhieu/fels_208/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ngovanhieu/fels_208/merges","archive_url":"https://api.github.com/repos/ngovanhieu/fels_208/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ngovanhieu/fels_208/downloads","issues_url":"https://api.github.com/repos/ngovanhieu/fels_208/issues{/number}","pulls_url":"https://api.github.com/repos/ngovanhieu/fels_208/pulls{/number}","milestones_url":"https://api.github.com/repos/ngovanhieu/fels_208/milestones{/number}","notifications_url":"https://api.github.com/repos/ngovanhieu/fels_208/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ngovanhieu/fels_208/labels{/name}","releases_url":"https://api.github.com/repos/ngovanhieu/fels_208/releases{/id}","deployments_url":"https://api.github.com/repos/ngovanhieu/fels_208/deployments","created_at":"2016-11-07T08:14:04Z","updated_at":"2016-10-28T06:45:45Z","pushed_at":"2016-11-14T04:14:51Z","git_url":"git://github.com/ngovanhieu/fels_208.git","ssh_url":"git@github.com:ngovanhieu/fels_208.git","clone_url":"https://github.com/ngovanhieu/fels_208.git","svn_url":"https://github.com/ngovanhieu/fels_208","homepage":null,"size":2180,"stargazers_count":0,"watchers_count":0,"language":null,"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":"master"}},"base":{"label":"framgia:develop","ref":"develop","sha":"ada058d7c9f2771e2be410b6127dc3352dfd08f8","user":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"repo":{"id":72181173,"name":"fels_208","full_name":"framgia/fels_208","owner":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/framgia/fels_208","description":"Framgia E-Learning System (training - PHP)","fork":false,"url":"https://api.github.com/repos/framgia/fels_208","forks_url":"https://api.github.com/repos/framgia/fels_208/forks","keys_url":"https://api.github.com/repos/framgia/fels_208/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/fels_208/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/fels_208/teams","hooks_url":"https://api.github.com/repos/framgia/fels_208/hooks","issue_events_url":"https://api.github.com/repos/framgia/fels_208/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/fels_208/events","assignees_url":"https://api.github.com/repos/framgia/fels_208/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/fels_208/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/fels_208/tags","blobs_url":"https://api.github.com/repos/framgia/fels_208/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/fels_208/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/fels_208/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/fels_208/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/fels_208/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/fels_208/languages","stargazers_url":"https://api.github.com/repos/framgia/fels_208/stargazers","contributors_url":"https://api.github.com/repos/framgia/fels_208/contributors","subscribers_url":"https://api.github.com/repos/framgia/fels_208/subscribers","subscription_url":"https://api.github.com/repos/framgia/fels_208/subscription","commits_url":"https://api.github.com/repos/framgia/fels_208/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/fels_208/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/fels_208/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/fels_208/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/fels_208/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/fels_208/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/fels_208/merges","archive_url":"https://api.github.com/repos/framgia/fels_208/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/fels_208/downloads","issues_url":"https://api.github.com/repos/framgia/fels_208/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/fels_208/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/fels_208/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/fels_208/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/fels_208/labels{/name}","releases_url":"https://api.github.com/repos/framgia/fels_208/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/fels_208/deployments","created_at":"2016-10-28T06:45:45Z","updated_at":"2016-10-28T06:45:45Z","pushed_at":"2016-11-14T04:14:52Z","git_url":"git://github.com/framgia/fels_208.git","ssh_url":"git@github.com:framgia/fels_208.git","clone_url":"https://github.com/framgia/fels_208.git","svn_url":"https://github.com/framgia/fels_208","homepage":null,"size":2190,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_208/pulls/18"},"html":{"href":"https://github.com/framgia/fels_208/pull/18"},"issue":{"href":"https://api.github.com/repos/framgia/fels_208/issues/18"},"comments":{"href":"https://api.github.com/repos/framgia/fels_208/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/fels_208/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/fels_208/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/fels_208/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/fels_208/statuses/c1d32571c277da0f69ee58ca4e97cb0620744083"}}}}
{"actor":{"display_login":"NgTheThao"}}