{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/tms_51/pulls/comments/62962293","id":62962293,"diff_hunk":"@@ -68,5 +69,24 @@ public function activities()\n     {\n         return $this->morphMany(Activity::class, 'actable');\n     }\n+\n+    public function finishSubject()\n+    {\n+        $taskInSubject = $this->tasks->pluck('id')->all();\n+        $userTasks = Auth::user()->tasks->whereIn('id', $taskInSubject);\n+        $isFinish = true;\n+        foreach ($userTasks as $task) {\n+            if (!$task->isPivotStatusFinish()) {\n+                $isFinish = false;\n+                return;","path":"app/Models/Subject.php","position":21,"original_position":21,"commit_id":"820c330bfda35015ec5d14bc3c5ffb8aa4d6117f","original_commit_id":"820c330bfda35015ec5d14bc3c5ffb8aa4d6117f","user":{"login":"midi9x","id":12813165,"avatar_url":"https://avatars.githubusercontent.com/u/12813165?v=3","gravatar_id":"","url":"https://api.github.com/users/midi9x","html_url":"https://github.com/midi9x","followers_url":"https://api.github.com/users/midi9x/followers","following_url":"https://api.github.com/users/midi9x/following{/other_user}","gists_url":"https://api.github.com/users/midi9x/gists{/gist_id}","starred_url":"https://api.github.com/users/midi9x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/midi9x/subscriptions","organizations_url":"https://api.github.com/users/midi9x/orgs","repos_url":"https://api.github.com/users/midi9x/repos","events_url":"https://api.github.com/users/midi9x/events{/privacy}","received_events_url":"https://api.github.com/users/midi9x/received_events","type":"User","site_admin":false},"body":"vâng để e test lại ak :)","created_at":"2016-05-12T03:56:02Z","updated_at":"2016-05-12T03:56:02Z","html_url":"https://github.com/framgia/tms_51/pull/16#discussion_r62962293","pull_request_url":"https://api.github.com/repos/framgia/tms_51/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/framgia/tms_51/pulls/comments/62962293"},"html":{"href":"https://github.com/framgia/tms_51/pull/16#discussion_r62962293"},"pull_request":{"href":"https://api.github.com/repos/framgia/tms_51/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/tms_51/pulls/16","id":69626971,"html_url":"https://github.com/framgia/tms_51/pull/16","diff_url":"https://github.com/framgia/tms_51/pull/16.diff","patch_url":"https://github.com/framgia/tms_51/pull/16.patch","issue_url":"https://api.github.com/repos/framgia/tms_51/issues/16","number":16,"state":"open","locked":false,"title":"Trainee finish a subject","user":{"login":"midi9x","id":12813165,"avatar_url":"https://avatars.githubusercontent.com/u/12813165?v=3","gravatar_id":"","url":"https://api.github.com/users/midi9x","html_url":"https://github.com/midi9x","followers_url":"https://api.github.com/users/midi9x/followers","following_url":"https://api.github.com/users/midi9x/following{/other_user}","gists_url":"https://api.github.com/users/midi9x/gists{/gist_id}","starred_url":"https://api.github.com/users/midi9x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/midi9x/subscriptions","organizations_url":"https://api.github.com/users/midi9x/orgs","repos_url":"https://api.github.com/users/midi9x/repos","events_url":"https://api.github.com/users/midi9x/events{/privacy}","received_events_url":"https://api.github.com/users/midi9x/received_events","type":"User","site_admin":false},"body":"Trainee finish a subject","created_at":"2016-05-11T07:35:48Z","updated_at":"2016-05-12T03:56:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cefa3235d81af2667f6e765890332ad16a2a2e1b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/framgia/tms_51/pulls/16/commits","review_comments_url":"https://api.github.com/repos/framgia/tms_51/pulls/16/comments","review_comment_url":"https://api.github.com/repos/framgia/tms_51/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/tms_51/issues/16/comments","statuses_url":"https://api.github.com/repos/framgia/tms_51/statuses/820c330bfda35015ec5d14bc3c5ffb8aa4d6117f","head":{"label":"midi9x:60065_trainee_finish_a_subject","ref":"60065_trainee_finish_a_subject","sha":"820c330bfda35015ec5d14bc3c5ffb8aa4d6117f","user":{"login":"midi9x","id":12813165,"avatar_url":"https://avatars.githubusercontent.com/u/12813165?v=3","gravatar_id":"","url":"https://api.github.com/users/midi9x","html_url":"https://github.com/midi9x","followers_url":"https://api.github.com/users/midi9x/followers","following_url":"https://api.github.com/users/midi9x/following{/other_user}","gists_url":"https://api.github.com/users/midi9x/gists{/gist_id}","starred_url":"https://api.github.com/users/midi9x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/midi9x/subscriptions","organizations_url":"https://api.github.com/users/midi9x/orgs","repos_url":"https://api.github.com/users/midi9x/repos","events_url":"https://api.github.com/users/midi9x/events{/privacy}","received_events_url":"https://api.github.com/users/midi9x/received_events","type":"User","site_admin":false},"repo":{"id":56111276,"name":"tms_51","full_name":"midi9x/tms_51","owner":{"login":"midi9x","id":12813165,"avatar_url":"https://avatars.githubusercontent.com/u/12813165?v=3","gravatar_id":"","url":"https://api.github.com/users/midi9x","html_url":"https://github.com/midi9x","followers_url":"https://api.github.com/users/midi9x/followers","following_url":"https://api.github.com/users/midi9x/following{/other_user}","gists_url":"https://api.github.com/users/midi9x/gists{/gist_id}","starred_url":"https://api.github.com/users/midi9x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/midi9x/subscriptions","organizations_url":"https://api.github.com/users/midi9x/orgs","repos_url":"https://api.github.com/users/midi9x/repos","events_url":"https://api.github.com/users/midi9x/events{/privacy}","received_events_url":"https://api.github.com/users/midi9x/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/midi9x/tms_51","description":"Framgia Training Management System (training)","fork":true,"url":"https://api.github.com/repos/midi9x/tms_51","forks_url":"https://api.github.com/repos/midi9x/tms_51/forks","keys_url":"https://api.github.com/repos/midi9x/tms_51/keys{/key_id}","collaborators_url":"https://api.github.com/repos/midi9x/tms_51/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/midi9x/tms_51/teams","hooks_url":"https://api.github.com/repos/midi9x/tms_51/hooks","issue_events_url":"https://api.github.com/repos/midi9x/tms_51/issues/events{/number}","events_url":"https://api.github.com/repos/midi9x/tms_51/events","assignees_url":"https://api.github.com/repos/midi9x/tms_51/assignees{/user}","branches_url":"https://api.github.com/repos/midi9x/tms_51/branches{/branch}","tags_url":"https://api.github.com/repos/midi9x/tms_51/tags","blobs_url":"https://api.github.com/repos/midi9x/tms_51/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/midi9x/tms_51/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/midi9x/tms_51/git/refs{/sha}","trees_url":"https://api.github.com/repos/midi9x/tms_51/git/trees{/sha}","statuses_url":"https://api.github.com/repos/midi9x/tms_51/statuses/{sha}","languages_url":"https://api.github.com/repos/midi9x/tms_51/languages","stargazers_url":"https://api.github.com/repos/midi9x/tms_51/stargazers","contributors_url":"https://api.github.com/repos/midi9x/tms_51/contributors","subscribers_url":"https://api.github.com/repos/midi9x/tms_51/subscribers","subscription_url":"https://api.github.com/repos/midi9x/tms_51/subscription","commits_url":"https://api.github.com/repos/midi9x/tms_51/commits{/sha}","git_commits_url":"https://api.github.com/repos/midi9x/tms_51/git/commits{/sha}","comments_url":"https://api.github.com/repos/midi9x/tms_51/comments{/number}","issue_comment_url":"https://api.github.com/repos/midi9x/tms_51/issues/comments{/number}","contents_url":"https://api.github.com/repos/midi9x/tms_51/contents/{+path}","compare_url":"https://api.github.com/repos/midi9x/tms_51/compare/{base}...{head}","merges_url":"https://api.github.com/repos/midi9x/tms_51/merges","archive_url":"https://api.github.com/repos/midi9x/tms_51/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/midi9x/tms_51/downloads","issues_url":"https://api.github.com/repos/midi9x/tms_51/issues{/number}","pulls_url":"https://api.github.com/repos/midi9x/tms_51/pulls{/number}","milestones_url":"https://api.github.com/repos/midi9x/tms_51/milestones{/number}","notifications_url":"https://api.github.com/repos/midi9x/tms_51/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/midi9x/tms_51/labels{/name}","releases_url":"https://api.github.com/repos/midi9x/tms_51/releases{/id}","deployments_url":"https://api.github.com/repos/midi9x/tms_51/deployments","created_at":"2016-04-13T01:35:38Z","updated_at":"2016-04-12T03:55:40Z","pushed_at":"2016-05-12T01:20:53Z","git_url":"git://github.com/midi9x/tms_51.git","ssh_url":"git@github.com:midi9x/tms_51.git","clone_url":"https://github.com/midi9x/tms_51.git","svn_url":"https://github.com/midi9x/tms_51","homepage":null,"size":349,"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":"0896af8142a2048001147083bb78a59efb661b34","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":56029372,"name":"tms_51","full_name":"framgia/tms_51","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/tms_51","description":"Framgia Training Management System (training)","fork":false,"url":"https://api.github.com/repos/framgia/tms_51","forks_url":"https://api.github.com/repos/framgia/tms_51/forks","keys_url":"https://api.github.com/repos/framgia/tms_51/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/tms_51/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/tms_51/teams","hooks_url":"https://api.github.com/repos/framgia/tms_51/hooks","issue_events_url":"https://api.github.com/repos/framgia/tms_51/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/tms_51/events","assignees_url":"https://api.github.com/repos/framgia/tms_51/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/tms_51/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/tms_51/tags","blobs_url":"https://api.github.com/repos/framgia/tms_51/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/tms_51/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/tms_51/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/tms_51/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/tms_51/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/tms_51/languages","stargazers_url":"https://api.github.com/repos/framgia/tms_51/stargazers","contributors_url":"https://api.github.com/repos/framgia/tms_51/contributors","subscribers_url":"https://api.github.com/repos/framgia/tms_51/subscribers","subscription_url":"https://api.github.com/repos/framgia/tms_51/subscription","commits_url":"https://api.github.com/repos/framgia/tms_51/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/tms_51/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/tms_51/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/tms_51/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/tms_51/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/tms_51/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/tms_51/merges","archive_url":"https://api.github.com/repos/framgia/tms_51/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/tms_51/downloads","issues_url":"https://api.github.com/repos/framgia/tms_51/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/tms_51/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/tms_51/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/tms_51/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/tms_51/labels{/name}","releases_url":"https://api.github.com/repos/framgia/tms_51/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/tms_51/deployments","created_at":"2016-04-12T03:55:40Z","updated_at":"2016-04-12T03:55:40Z","pushed_at":"2016-05-12T01:20:54Z","git_url":"git://github.com/framgia/tms_51.git","ssh_url":"git@github.com:framgia/tms_51.git","clone_url":"https://github.com/framgia/tms_51.git","svn_url":"https://github.com/framgia/tms_51","homepage":null,"size":348,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/tms_51/pulls/16"},"html":{"href":"https://github.com/framgia/tms_51/pull/16"},"issue":{"href":"https://api.github.com/repos/framgia/tms_51/issues/16"},"comments":{"href":"https://api.github.com/repos/framgia/tms_51/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/tms_51/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/tms_51/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/tms_51/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/tms_51/statuses/820c330bfda35015ec5d14bc3c5ffb8aa4d6117f"}}}}