{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/servey_01/pulls/comments/187894630","pull_request_review_id":119763098,"id":187894630,"diff_hunk":"@@ -17,9 +19,38 @@ public function __construct(SurveyInterface $surveyRepository)\n \n     public function result($token)\n     {\n-        $survey = $this->surveyRepository->where('token', $token)->first();\n-        $resultsSurveys = $this->surveyRepository->getResutlSurvey($token);\n+        $survey = $this->surveyRepository->where('token', $token)->with('sections.questions.answers.results')->first();\n+        $resultsSurveys = $this->surveyRepository->getResutlSurvey($survey);\n \n         return view('clients.survey.result.index', compact('survey', 'resultsSurveys'));\n     }\n+\n+    public function export($token, $type, $name)\n+    {\n+        try {\n+            $survey = $this->surveyRepository->where('token', $token)->first();\n+\n+            if(!$survey) {\n+                throw new Exception('Survey not fould', 1);\n+            }\n+\n+            $data = $this->surveyRepository->getResultExport($survey);\n+            $title = str_limit($survey->title, config('settings.limit_title_excel'));\n+\n+            if(!$name) {\n+                $title = str_limit($survey->title, config('settings.limit_title_excel'));","path":"app/Http/Controllers/Survey/ResultController.php","position":34,"original_position":34,"commit_id":"c3078f4a841825ae51965021c1f35fe51de0d3e8","original_commit_id":"c3078f4a841825ae51965021c1f35fe51de0d3e8","user":{"login":"trangkarol","id":19767833,"avatar_url":"https://avatars1.githubusercontent.com/u/19767833?v=4","gravatar_id":"","url":"https://api.github.com/users/trangkarol","html_url":"https://github.com/trangkarol","followers_url":"https://api.github.com/users/trangkarol/followers","following_url":"https://api.github.com/users/trangkarol/following{/other_user}","gists_url":"https://api.github.com/users/trangkarol/gists{/gist_id}","starred_url":"https://api.github.com/users/trangkarol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trangkarol/subscriptions","organizations_url":"https://api.github.com/users/trangkarol/orgs","repos_url":"https://api.github.com/users/trangkarol/repos","events_url":"https://api.github.com/users/trangkarol/events{/privacy}","received_events_url":"https://api.github.com/users/trangkarol/received_events","type":"User","site_admin":false},"body":"nên dùng toán tử `? :`","created_at":"2018-05-14T09:51:06Z","updated_at":"2018-05-14T09:51:51Z","html_url":"https://github.com/framgia/servey_01/pull/264#discussion_r187894630","pull_request_url":"https://api.github.com/repos/framgia/servey_01/pulls/264","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/framgia/servey_01/pulls/comments/187894630"},"html":{"href":"https://github.com/framgia/servey_01/pull/264#discussion_r187894630"},"pull_request":{"href":"https://api.github.com/repos/framgia/servey_01/pulls/264"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/servey_01/pulls/264","id":187756065,"html_url":"https://github.com/framgia/servey_01/pull/264","diff_url":"https://github.com/framgia/servey_01/pull/264.diff","patch_url":"https://github.com/framgia/servey_01/pull/264.patch","issue_url":"https://api.github.com/repos/framgia/servey_01/issues/264","number":264,"state":"open","locked":false,"title":"export excel","user":{"login":"nguyenhathanh2212","id":18241956,"avatar_url":"https://avatars1.githubusercontent.com/u/18241956?v=4","gravatar_id":"","url":"https://api.github.com/users/nguyenhathanh2212","html_url":"https://github.com/nguyenhathanh2212","followers_url":"https://api.github.com/users/nguyenhathanh2212/followers","following_url":"https://api.github.com/users/nguyenhathanh2212/following{/other_user}","gists_url":"https://api.github.com/users/nguyenhathanh2212/gists{/gist_id}","starred_url":"https://api.github.com/users/nguyenhathanh2212/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nguyenhathanh2212/subscriptions","organizations_url":"https://api.github.com/users/nguyenhathanh2212/orgs","repos_url":"https://api.github.com/users/nguyenhathanh2212/repos","events_url":"https://api.github.com/users/nguyenhathanh2212/events{/privacy}","received_events_url":"https://api.github.com/users/nguyenhathanh2212/received_events","type":"User","site_admin":false},"body":"redmine: https://dev.framgia.com/redmine/issues/172258\r\n![peek 2018-05-14 15-25](https://user-images.githubusercontent.com/18241956/39986937-6b964fb2-578d-11e8-9fe6-23de3a0079f9.gif)\r\n","created_at":"2018-05-14T08:43:01Z","updated_at":"2018-05-14T09:51:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"24de5c7810ce7e50550506a3d989c57ccd3be762","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/servey_01/pulls/264/commits","review_comments_url":"https://api.github.com/repos/framgia/servey_01/pulls/264/comments","review_comment_url":"https://api.github.com/repos/framgia/servey_01/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/servey_01/issues/264/comments","statuses_url":"https://api.github.com/repos/framgia/servey_01/statuses/c3078f4a841825ae51965021c1f35fe51de0d3e8","head":{"label":"nguyenhathanh2212:export-excel","ref":"export-excel","sha":"c3078f4a841825ae51965021c1f35fe51de0d3e8","user":{"login":"nguyenhathanh2212","id":18241956,"avatar_url":"https://avatars1.githubusercontent.com/u/18241956?v=4","gravatar_id":"","url":"https://api.github.com/users/nguyenhathanh2212","html_url":"https://github.com/nguyenhathanh2212","followers_url":"https://api.github.com/users/nguyenhathanh2212/followers","following_url":"https://api.github.com/users/nguyenhathanh2212/following{/other_user}","gists_url":"https://api.github.com/users/nguyenhathanh2212/gists{/gist_id}","starred_url":"https://api.github.com/users/nguyenhathanh2212/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nguyenhathanh2212/subscriptions","organizations_url":"https://api.github.com/users/nguyenhathanh2212/orgs","repos_url":"https://api.github.com/users/nguyenhathanh2212/repos","events_url":"https://api.github.com/users/nguyenhathanh2212/events{/privacy}","received_events_url":"https://api.github.com/users/nguyenhathanh2212/received_events","type":"User","site_admin":false},"repo":{"id":126939046,"name":"servey_01","full_name":"nguyenhathanh2212/servey_01","owner":{"login":"nguyenhathanh2212","id":18241956,"avatar_url":"https://avatars1.githubusercontent.com/u/18241956?v=4","gravatar_id":"","url":"https://api.github.com/users/nguyenhathanh2212","html_url":"https://github.com/nguyenhathanh2212","followers_url":"https://api.github.com/users/nguyenhathanh2212/followers","following_url":"https://api.github.com/users/nguyenhathanh2212/following{/other_user}","gists_url":"https://api.github.com/users/nguyenhathanh2212/gists{/gist_id}","starred_url":"https://api.github.com/users/nguyenhathanh2212/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nguyenhathanh2212/subscriptions","organizations_url":"https://api.github.com/users/nguyenhathanh2212/orgs","repos_url":"https://api.github.com/users/nguyenhathanh2212/repos","events_url":"https://api.github.com/users/nguyenhathanh2212/events{/privacy}","received_events_url":"https://api.github.com/users/nguyenhathanh2212/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nguyenhathanh2212/servey_01","description":null,"fork":true,"url":"https://api.github.com/repos/nguyenhathanh2212/servey_01","forks_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/forks","keys_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/teams","hooks_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/hooks","issue_events_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/issues/events{/number}","events_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/events","assignees_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/assignees{/user}","branches_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/branches{/branch}","tags_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/tags","blobs_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/git/refs{/sha}","trees_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/statuses/{sha}","languages_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/languages","stargazers_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/stargazers","contributors_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/contributors","subscribers_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/subscribers","subscription_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/subscription","commits_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/commits{/sha}","git_commits_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/git/commits{/sha}","comments_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/comments{/number}","issue_comment_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/issues/comments{/number}","contents_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/contents/{+path}","compare_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/merges","archive_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/downloads","issues_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/issues{/number}","pulls_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/pulls{/number}","milestones_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/milestones{/number}","notifications_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/labels{/name}","releases_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/releases{/id}","deployments_url":"https://api.github.com/repos/nguyenhathanh2212/servey_01/deployments","created_at":"2018-03-27T06:24:45Z","updated_at":"2018-03-27T06:24:47Z","pushed_at":"2018-05-14T09:42:06Z","git_url":"git://github.com/nguyenhathanh2212/servey_01.git","ssh_url":"git@github.com:nguyenhathanh2212/servey_01.git","clone_url":"https://github.com/nguyenhathanh2212/servey_01.git","svn_url":"https://github.com/nguyenhathanh2212/servey_01","homepage":null,"size":19139,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"framgia:improve_view","ref":"improve_view","sha":"6b4a49f14eddac8e2bdaa9d8eb3f08aab2bde053","user":{"login":"framgia","id":2322183,"avatar_url":"https://avatars3.githubusercontent.com/u/2322183?v=4","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":78068076,"name":"servey_01","full_name":"framgia/servey_01","owner":{"login":"framgia","id":2322183,"avatar_url":"https://avatars3.githubusercontent.com/u/2322183?v=4","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/servey_01","description":null,"fork":false,"url":"https://api.github.com/repos/framgia/servey_01","forks_url":"https://api.github.com/repos/framgia/servey_01/forks","keys_url":"https://api.github.com/repos/framgia/servey_01/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/servey_01/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/servey_01/teams","hooks_url":"https://api.github.com/repos/framgia/servey_01/hooks","issue_events_url":"https://api.github.com/repos/framgia/servey_01/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/servey_01/events","assignees_url":"https://api.github.com/repos/framgia/servey_01/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/servey_01/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/servey_01/tags","blobs_url":"https://api.github.com/repos/framgia/servey_01/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/servey_01/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/servey_01/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/servey_01/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/servey_01/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/servey_01/languages","stargazers_url":"https://api.github.com/repos/framgia/servey_01/stargazers","contributors_url":"https://api.github.com/repos/framgia/servey_01/contributors","subscribers_url":"https://api.github.com/repos/framgia/servey_01/subscribers","subscription_url":"https://api.github.com/repos/framgia/servey_01/subscription","commits_url":"https://api.github.com/repos/framgia/servey_01/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/servey_01/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/servey_01/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/servey_01/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/servey_01/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/servey_01/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/servey_01/merges","archive_url":"https://api.github.com/repos/framgia/servey_01/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/servey_01/downloads","issues_url":"https://api.github.com/repos/framgia/servey_01/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/servey_01/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/servey_01/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/servey_01/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/servey_01/labels{/name}","releases_url":"https://api.github.com/repos/framgia/servey_01/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/servey_01/deployments","created_at":"2017-01-05T01:37:19Z","updated_at":"2018-03-29T02:58:47Z","pushed_at":"2018-05-14T09:42:08Z","git_url":"git://github.com/framgia/servey_01.git","ssh_url":"git@github.com:framgia/servey_01.git","clone_url":"https://github.com/framgia/servey_01.git","svn_url":"https://github.com/framgia/servey_01","homepage":null,"size":19137,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":12,"open_issues":4,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/servey_01/pulls/264"},"html":{"href":"https://github.com/framgia/servey_01/pull/264"},"issue":{"href":"https://api.github.com/repos/framgia/servey_01/issues/264"},"comments":{"href":"https://api.github.com/repos/framgia/servey_01/issues/264/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/servey_01/pulls/264/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/servey_01/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/servey_01/pulls/264/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/servey_01/statuses/c3078f4a841825ae51965021c1f35fe51de0d3e8"}},"author_association":"NONE"}}
{"actor":{"display_login":"trangkarol"}}