{"action":"created","comment":{"url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/pulls/comments/307556513","pull_request_review_id":266953066,"id":307556513,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMwNzU1NjUxMw==","diff_hunk":"@@ -3,9 +3,53 @@\n namespace App\\Models;\n \n use Illuminate\\Database\\Eloquent\\Model;\n+use Illuminate\\Database\\Eloquent\\SoftDeletes;\n \n class Question extends Model\n {\n-    //\n+    protected $fillable = [\n+        'user_id',\n+        'tag_category_id',\n+        'title',\n+        'content'\n+    ];\n+\n+    public function comments()\n+    {\n+        return $this->hasMany(Comment::class);\n+    }\n+\n+    public function tagCategory()\n+    {\n+        return $this->belongsTo(TagCategory::class);\n+    }\n+\n+    public function user()\n+    {\n+        return $this->belongsTo(User::class);\n+    }\n+\n+    public function scopeSearchQuestions($query, $searchWord)\n+    {\n+        if (isset($searchWord)) {\n+            return $query->where('title', 'like', $searchWord)->with(['user', 'comments', 'tagCategory'])->latest();\n+        } else {\n+            return $query->with(['user', 'comments', 'tagCategory'])->latest();\n+        }\n+    }\n+\n+    public function scopeSelectQuestions($query, $tagCategoryId)\n+    {\n+        if (isset($tagCategoryId)) {\n+            return $query->where('tag_category_id', $tagCategoryId)->with(['user', 'comments', 'tagCategory'])->latest();\n+        } else {\n+            return $query->with(['user', 'comments', 'tagCategory'])->latest();\n+        }\n+    }\n+\n+    public function fetchAllQuestions()","path":"app/Models/Question.php","position":49,"original_position":49,"commit_id":"616b1f69477b8beab3c7ede0b86d7c320f547c1d","original_commit_id":"616b1f69477b8beab3c7ede0b86d7c320f547c1d","user":{"login":"monji05","id":40932224,"node_id":"MDQ6VXNlcjQwOTMyMjI0","avatar_url":"https://avatars3.githubusercontent.com/u/40932224?v=4","gravatar_id":"","url":"https://api.github.com/users/monji05","html_url":"https://github.com/monji05","followers_url":"https://api.github.com/users/monji05/followers","following_url":"https://api.github.com/users/monji05/following{/other_user}","gists_url":"https://api.github.com/users/monji05/gists{/gist_id}","starred_url":"https://api.github.com/users/monji05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monji05/subscriptions","organizations_url":"https://api.github.com/users/monji05/orgs","repos_url":"https://api.github.com/users/monji05/repos","events_url":"https://api.github.com/users/monji05/events{/privacy}","received_events_url":"https://api.github.com/users/monji05/received_events","type":"User","site_admin":false},"body":"修正しました","created_at":"2019-07-26T01:14:01Z","updated_at":"2019-07-26T01:14:01Z","html_url":"https://github.com/gizumo-inc/dev_gizlog/pull/54#discussion_r307556513","pull_request_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/pulls/54","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/gizumo-inc/dev_gizlog/pulls/comments/307556513"},"html":{"href":"https://github.com/gizumo-inc/dev_gizlog/pull/54#discussion_r307556513"},"pull_request":{"href":"https://api.github.com/repos/gizumo-inc/dev_gizlog/pulls/54"}},"in_reply_to_id":307102171},"pull_request":{"url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/pulls/54","id":299243399,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjk5MjQzMzk5","html_url":"https://github.com/gizumo-inc/dev_gizlog/pull/54","diff_url":"https://github.com/gizumo-inc/dev_gizlog/pull/54.diff","patch_url":"https://github.com/gizumo-inc/dev_gizlog/pull/54.patch","issue_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/issues/54","number":54,"state":"open","locked":false,"title":"mishina_lesson_question","user":{"login":"monji05","id":40932224,"node_id":"MDQ6VXNlcjQwOTMyMjI0","avatar_url":"https://avatars3.githubusercontent.com/u/40932224?v=4","gravatar_id":"","url":"https://api.github.com/users/monji05","html_url":"https://github.com/monji05","followers_url":"https://api.github.com/users/monji05/followers","following_url":"https://api.github.com/users/monji05/following{/other_user}","gists_url":"https://api.github.com/users/monji05/gists{/gist_id}","starred_url":"https://api.github.com/users/monji05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monji05/subscriptions","organizations_url":"https://api.github.com/users/monji05/orgs","repos_url":"https://api.github.com/users/monji05/repos","events_url":"https://api.github.com/users/monji05/events{/privacy}","received_events_url":"https://api.github.com/users/monji05/received_events","type":"User","site_admin":false},"body":"","created_at":"2019-07-19T08:52:46Z","updated_at":"2019-07-26T01:14:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8e15aedf4030f596598d90d7842c5055fb12c491","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/pulls/54/commits","review_comments_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/pulls/54/comments","review_comment_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/issues/54/comments","statuses_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/statuses/616b1f69477b8beab3c7ede0b86d7c320f547c1d","head":{"label":"monji05:lesson_question","ref":"lesson_question","sha":"616b1f69477b8beab3c7ede0b86d7c320f547c1d","user":{"login":"monji05","id":40932224,"node_id":"MDQ6VXNlcjQwOTMyMjI0","avatar_url":"https://avatars3.githubusercontent.com/u/40932224?v=4","gravatar_id":"","url":"https://api.github.com/users/monji05","html_url":"https://github.com/monji05","followers_url":"https://api.github.com/users/monji05/followers","following_url":"https://api.github.com/users/monji05/following{/other_user}","gists_url":"https://api.github.com/users/monji05/gists{/gist_id}","starred_url":"https://api.github.com/users/monji05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monji05/subscriptions","organizations_url":"https://api.github.com/users/monji05/orgs","repos_url":"https://api.github.com/users/monji05/repos","events_url":"https://api.github.com/users/monji05/events{/privacy}","received_events_url":"https://api.github.com/users/monji05/received_events","type":"User","site_admin":false},"repo":{"id":192504698,"node_id":"MDEwOlJlcG9zaXRvcnkxOTI1MDQ2OTg=","name":"dev_gizlog","full_name":"monji05/dev_gizlog","private":false,"owner":{"login":"monji05","id":40932224,"node_id":"MDQ6VXNlcjQwOTMyMjI0","avatar_url":"https://avatars3.githubusercontent.com/u/40932224?v=4","gravatar_id":"","url":"https://api.github.com/users/monji05","html_url":"https://github.com/monji05","followers_url":"https://api.github.com/users/monji05/followers","following_url":"https://api.github.com/users/monji05/following{/other_user}","gists_url":"https://api.github.com/users/monji05/gists{/gist_id}","starred_url":"https://api.github.com/users/monji05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monji05/subscriptions","organizations_url":"https://api.github.com/users/monji05/orgs","repos_url":"https://api.github.com/users/monji05/repos","events_url":"https://api.github.com/users/monji05/events{/privacy}","received_events_url":"https://api.github.com/users/monji05/received_events","type":"User","site_admin":false},"html_url":"https://github.com/monji05/dev_gizlog","description":null,"fork":true,"url":"https://api.github.com/repos/monji05/dev_gizlog","forks_url":"https://api.github.com/repos/monji05/dev_gizlog/forks","keys_url":"https://api.github.com/repos/monji05/dev_gizlog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/monji05/dev_gizlog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/monji05/dev_gizlog/teams","hooks_url":"https://api.github.com/repos/monji05/dev_gizlog/hooks","issue_events_url":"https://api.github.com/repos/monji05/dev_gizlog/issues/events{/number}","events_url":"https://api.github.com/repos/monji05/dev_gizlog/events","assignees_url":"https://api.github.com/repos/monji05/dev_gizlog/assignees{/user}","branches_url":"https://api.github.com/repos/monji05/dev_gizlog/branches{/branch}","tags_url":"https://api.github.com/repos/monji05/dev_gizlog/tags","blobs_url":"https://api.github.com/repos/monji05/dev_gizlog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/monji05/dev_gizlog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/monji05/dev_gizlog/git/refs{/sha}","trees_url":"https://api.github.com/repos/monji05/dev_gizlog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/monji05/dev_gizlog/statuses/{sha}","languages_url":"https://api.github.com/repos/monji05/dev_gizlog/languages","stargazers_url":"https://api.github.com/repos/monji05/dev_gizlog/stargazers","contributors_url":"https://api.github.com/repos/monji05/dev_gizlog/contributors","subscribers_url":"https://api.github.com/repos/monji05/dev_gizlog/subscribers","subscription_url":"https://api.github.com/repos/monji05/dev_gizlog/subscription","commits_url":"https://api.github.com/repos/monji05/dev_gizlog/commits{/sha}","git_commits_url":"https://api.github.com/repos/monji05/dev_gizlog/git/commits{/sha}","comments_url":"https://api.github.com/repos/monji05/dev_gizlog/comments{/number}","issue_comment_url":"https://api.github.com/repos/monji05/dev_gizlog/issues/comments{/number}","contents_url":"https://api.github.com/repos/monji05/dev_gizlog/contents/{+path}","compare_url":"https://api.github.com/repos/monji05/dev_gizlog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/monji05/dev_gizlog/merges","archive_url":"https://api.github.com/repos/monji05/dev_gizlog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/monji05/dev_gizlog/downloads","issues_url":"https://api.github.com/repos/monji05/dev_gizlog/issues{/number}","pulls_url":"https://api.github.com/repos/monji05/dev_gizlog/pulls{/number}","milestones_url":"https://api.github.com/repos/monji05/dev_gizlog/milestones{/number}","notifications_url":"https://api.github.com/repos/monji05/dev_gizlog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/monji05/dev_gizlog/labels{/name}","releases_url":"https://api.github.com/repos/monji05/dev_gizlog/releases{/id}","deployments_url":"https://api.github.com/repos/monji05/dev_gizlog/deployments","created_at":"2019-06-18T09:04:19Z","updated_at":"2019-06-18T09:04:27Z","pushed_at":"2019-07-24T13:14:52Z","git_url":"git://github.com/monji05/dev_gizlog.git","ssh_url":"git@github.com:monji05/dev_gizlog.git","clone_url":"https://github.com/monji05/dev_gizlog.git","svn_url":"https://github.com/monji05/dev_gizlog","homepage":null,"size":529,"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,"disabled":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gizumo-inc:lesson_question","ref":"lesson_question","sha":"ac7de78b449bb876f7dfabce33209e1c42210ca6","user":{"login":"gizumo-inc","id":13496465,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDk2NDY1","avatar_url":"https://avatars2.githubusercontent.com/u/13496465?v=4","gravatar_id":"","url":"https://api.github.com/users/gizumo-inc","html_url":"https://github.com/gizumo-inc","followers_url":"https://api.github.com/users/gizumo-inc/followers","following_url":"https://api.github.com/users/gizumo-inc/following{/other_user}","gists_url":"https://api.github.com/users/gizumo-inc/gists{/gist_id}","starred_url":"https://api.github.com/users/gizumo-inc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gizumo-inc/subscriptions","organizations_url":"https://api.github.com/users/gizumo-inc/orgs","repos_url":"https://api.github.com/users/gizumo-inc/repos","events_url":"https://api.github.com/users/gizumo-inc/events{/privacy}","received_events_url":"https://api.github.com/users/gizumo-inc/received_events","type":"Organization","site_admin":false},"repo":{"id":181866807,"node_id":"MDEwOlJlcG9zaXRvcnkxODE4NjY4MDc=","name":"dev_gizlog","full_name":"gizumo-inc/dev_gizlog","private":false,"owner":{"login":"gizumo-inc","id":13496465,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDk2NDY1","avatar_url":"https://avatars2.githubusercontent.com/u/13496465?v=4","gravatar_id":"","url":"https://api.github.com/users/gizumo-inc","html_url":"https://github.com/gizumo-inc","followers_url":"https://api.github.com/users/gizumo-inc/followers","following_url":"https://api.github.com/users/gizumo-inc/following{/other_user}","gists_url":"https://api.github.com/users/gizumo-inc/gists{/gist_id}","starred_url":"https://api.github.com/users/gizumo-inc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gizumo-inc/subscriptions","organizations_url":"https://api.github.com/users/gizumo-inc/orgs","repos_url":"https://api.github.com/users/gizumo-inc/repos","events_url":"https://api.github.com/users/gizumo-inc/events{/privacy}","received_events_url":"https://api.github.com/users/gizumo-inc/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/gizumo-inc/dev_gizlog","description":null,"fork":false,"url":"https://api.github.com/repos/gizumo-inc/dev_gizlog","forks_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/forks","keys_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/teams","hooks_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/hooks","issue_events_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/issues/events{/number}","events_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/events","assignees_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/assignees{/user}","branches_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/branches{/branch}","tags_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/tags","blobs_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/git/refs{/sha}","trees_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/statuses/{sha}","languages_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/languages","stargazers_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/stargazers","contributors_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/contributors","subscribers_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/subscribers","subscription_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/subscription","commits_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/commits{/sha}","git_commits_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/git/commits{/sha}","comments_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/comments{/number}","issue_comment_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/issues/comments{/number}","contents_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/contents/{+path}","compare_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/merges","archive_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/downloads","issues_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/issues{/number}","pulls_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/pulls{/number}","milestones_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/milestones{/number}","notifications_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/labels{/name}","releases_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/releases{/id}","deployments_url":"https://api.github.com/repos/gizumo-inc/dev_gizlog/deployments","created_at":"2019-04-17T10:13:02Z","updated_at":"2019-04-19T07:17:34Z","pushed_at":"2019-07-26T00:19:17Z","git_url":"git://github.com/gizumo-inc/dev_gizlog.git","ssh_url":"git@github.com:gizumo-inc/dev_gizlog.git","clone_url":"https://github.com/gizumo-inc/dev_gizlog.git","svn_url":"https://github.com/gizumo-inc/dev_gizlog","homepage":null,"size":466,"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":37,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":12,"license":null,"forks":37,"open_issues":12,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gizumo-inc/dev_gizlog/pulls/54"},"html":{"href":"https://github.com/gizumo-inc/dev_gizlog/pull/54"},"issue":{"href":"https://api.github.com/repos/gizumo-inc/dev_gizlog/issues/54"},"comments":{"href":"https://api.github.com/repos/gizumo-inc/dev_gizlog/issues/54/comments"},"review_comments":{"href":"https://api.github.com/repos/gizumo-inc/dev_gizlog/pulls/54/comments"},"review_comment":{"href":"https://api.github.com/repos/gizumo-inc/dev_gizlog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gizumo-inc/dev_gizlog/pulls/54/commits"},"statuses":{"href":"https://api.github.com/repos/gizumo-inc/dev_gizlog/statuses/616b1f69477b8beab3c7ede0b86d7c320f547c1d"}},"author_association":"NONE"}}
{"actor":{"display_login":"monji05"}}