{"action":"created","comment":{"url":"https://api.github.com/repos/laravel/framework/pulls/comments/230226661","pull_request_review_id":170917584,"id":230226661,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMDIyNjY2MQ==","diff_hunk":"@@ -560,6 +560,24 @@ public function domain($domain = null)\n         return $this;\n     }\n \n+    /**\n+     * Get the sub domain for the route.\n+     *\n+     * @param string $subDomain\n+     * @param string|null $domain\n+     * @return $this\n+     */\n+    public function subDomain($subDomain, $domain = null)\n+    {\n+        if (is_null($domain)) {\n+            $domain = parse_url(getenv('APP_URL'))['host'];","path":"src/Illuminate/Routing/Route.php","position":14,"original_position":14,"commit_id":"39d64c5233b01f736a3eb8ee42dedc2c858e14a0","original_commit_id":"39d64c5233b01f736a3eb8ee42dedc2c858e14a0","user":{"login":"hichxm","id":12587585,"node_id":"MDQ6VXNlcjEyNTg3NTg1","avatar_url":"https://avatars1.githubusercontent.com/u/12587585?v=4","gravatar_id":"","url":"https://api.github.com/users/hichxm","html_url":"https://github.com/hichxm","followers_url":"https://api.github.com/users/hichxm/followers","following_url":"https://api.github.com/users/hichxm/following{/other_user}","gists_url":"https://api.github.com/users/hichxm/gists{/gist_id}","starred_url":"https://api.github.com/users/hichxm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hichxm/subscriptions","organizations_url":"https://api.github.com/users/hichxm/orgs","repos_url":"https://api.github.com/users/hichxm/repos","events_url":"https://api.github.com/users/hichxm/events{/privacy}","received_events_url":"https://api.github.com/users/hichxm/received_events","type":"User","site_admin":false},"body":"Yes, but what should I use?","created_at":"2018-11-01T22:57:57Z","updated_at":"2018-11-01T22:57:58Z","html_url":"https://github.com/laravel/framework/pull/26344#discussion_r230226661","pull_request_url":"https://api.github.com/repos/laravel/framework/pulls/26344","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/laravel/framework/pulls/comments/230226661"},"html":{"href":"https://github.com/laravel/framework/pull/26344#discussion_r230226661"},"pull_request":{"href":"https://api.github.com/repos/laravel/framework/pulls/26344"}},"in_reply_to_id":230213755},"pull_request":{"url":"https://api.github.com/repos/laravel/framework/pulls/26344","id":227633819,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI3NjMzODE5","html_url":"https://github.com/laravel/framework/pull/26344","diff_url":"https://github.com/laravel/framework/pull/26344.diff","patch_url":"https://github.com/laravel/framework/pull/26344.patch","issue_url":"https://api.github.com/repos/laravel/framework/issues/26344","number":26344,"state":"open","locked":false,"title":"[5.7] Add sub domain method","user":{"login":"hichxm","id":12587585,"node_id":"MDQ6VXNlcjEyNTg3NTg1","avatar_url":"https://avatars1.githubusercontent.com/u/12587585?v=4","gravatar_id":"","url":"https://api.github.com/users/hichxm","html_url":"https://github.com/hichxm","followers_url":"https://api.github.com/users/hichxm/followers","following_url":"https://api.github.com/users/hichxm/following{/other_user}","gists_url":"https://api.github.com/users/hichxm/gists{/gist_id}","starred_url":"https://api.github.com/users/hichxm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hichxm/subscriptions","organizations_url":"https://api.github.com/users/hichxm/orgs","repos_url":"https://api.github.com/users/hichxm/repos","events_url":"https://api.github.com/users/hichxm/events{/privacy}","received_events_url":"https://api.github.com/users/hichxm/received_events","type":"User","site_admin":false},"body":"My old pull request (#26341) was closed because I used the function \"env\" in the routing component.\r\n\r\nThis pull request concerns the addition of a method named \"subDomain\" that will make subdomains easier than the old method that was to write the domain name in the code.\r\n\r\n### old method:\r\n```php\r\nuse Illuminate\\Support\\Facades\\Route;\r\n\r\nRoute::domain(\"sub0.foo.bar\")->group(...);\r\nRoute::domain(\"sub1.mydomain.test\")->group(...);\r\nRoute::domain(\"sub2.foo.bar\")->group(...);\r\nRoute::domain(\"sub3.foo.bar\")->group(...);\r\n```\r\n\r\n### new method:\r\n```php\r\nuse Illuminate\\Support\\Facades\\Route;\r\n\r\n// env: APP_URL = http://foo.bar/\r\n\r\nRoute::subDomain(\"sub0\")->group(...); // domain as sub0.foo.bar\r\nRoute::subDomain(\"sub1\", \"mydomain.test\")->group(...); // domain as sub1.mydomain.test\r\nRoute::subDomain(\"sub2\")->group(...); // domain as sub2.foo.bar\r\nRoute::subDomain(\"sub3\")->group(...); // domain as sub3.foo.bar\r\n```\r\n\r\nThe new method is better because the domain name is not versioned, gets the domain name from the environment file \".env\".","created_at":"2018-11-01T14:18:13Z","updated_at":"2018-11-01T22:57:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b65a868c684fc0f08c79d8eba578ec05086bd5c3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/laravel/framework/pulls/26344/commits","review_comments_url":"https://api.github.com/repos/laravel/framework/pulls/26344/comments","review_comment_url":"https://api.github.com/repos/laravel/framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/laravel/framework/issues/26344/comments","statuses_url":"https://api.github.com/repos/laravel/framework/statuses/39d64c5233b01f736a3eb8ee42dedc2c858e14a0","head":{"label":"hichxm:add-subdomain-method","ref":"add-subdomain-method","sha":"39d64c5233b01f736a3eb8ee42dedc2c858e14a0","user":{"login":"hichxm","id":12587585,"node_id":"MDQ6VXNlcjEyNTg3NTg1","avatar_url":"https://avatars1.githubusercontent.com/u/12587585?v=4","gravatar_id":"","url":"https://api.github.com/users/hichxm","html_url":"https://github.com/hichxm","followers_url":"https://api.github.com/users/hichxm/followers","following_url":"https://api.github.com/users/hichxm/following{/other_user}","gists_url":"https://api.github.com/users/hichxm/gists{/gist_id}","starred_url":"https://api.github.com/users/hichxm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hichxm/subscriptions","organizations_url":"https://api.github.com/users/hichxm/orgs","repos_url":"https://api.github.com/users/hichxm/repos","events_url":"https://api.github.com/users/hichxm/events{/privacy}","received_events_url":"https://api.github.com/users/hichxm/received_events","type":"User","site_admin":false},"repo":{"id":155706151,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU3MDYxNTE=","name":"framework","full_name":"hichxm/framework","private":false,"owner":{"login":"hichxm","id":12587585,"node_id":"MDQ6VXNlcjEyNTg3NTg1","avatar_url":"https://avatars1.githubusercontent.com/u/12587585?v=4","gravatar_id":"","url":"https://api.github.com/users/hichxm","html_url":"https://github.com/hichxm","followers_url":"https://api.github.com/users/hichxm/followers","following_url":"https://api.github.com/users/hichxm/following{/other_user}","gists_url":"https://api.github.com/users/hichxm/gists{/gist_id}","starred_url":"https://api.github.com/users/hichxm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hichxm/subscriptions","organizations_url":"https://api.github.com/users/hichxm/orgs","repos_url":"https://api.github.com/users/hichxm/repos","events_url":"https://api.github.com/users/hichxm/events{/privacy}","received_events_url":"https://api.github.com/users/hichxm/received_events","type":"User","site_admin":false},"html_url":"https://github.com/hichxm/framework","description":null,"fork":true,"url":"https://api.github.com/repos/hichxm/framework","forks_url":"https://api.github.com/repos/hichxm/framework/forks","keys_url":"https://api.github.com/repos/hichxm/framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hichxm/framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hichxm/framework/teams","hooks_url":"https://api.github.com/repos/hichxm/framework/hooks","issue_events_url":"https://api.github.com/repos/hichxm/framework/issues/events{/number}","events_url":"https://api.github.com/repos/hichxm/framework/events","assignees_url":"https://api.github.com/repos/hichxm/framework/assignees{/user}","branches_url":"https://api.github.com/repos/hichxm/framework/branches{/branch}","tags_url":"https://api.github.com/repos/hichxm/framework/tags","blobs_url":"https://api.github.com/repos/hichxm/framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hichxm/framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hichxm/framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/hichxm/framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hichxm/framework/statuses/{sha}","languages_url":"https://api.github.com/repos/hichxm/framework/languages","stargazers_url":"https://api.github.com/repos/hichxm/framework/stargazers","contributors_url":"https://api.github.com/repos/hichxm/framework/contributors","subscribers_url":"https://api.github.com/repos/hichxm/framework/subscribers","subscription_url":"https://api.github.com/repos/hichxm/framework/subscription","commits_url":"https://api.github.com/repos/hichxm/framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/hichxm/framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/hichxm/framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/hichxm/framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/hichxm/framework/contents/{+path}","compare_url":"https://api.github.com/repos/hichxm/framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hichxm/framework/merges","archive_url":"https://api.github.com/repos/hichxm/framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hichxm/framework/downloads","issues_url":"https://api.github.com/repos/hichxm/framework/issues{/number}","pulls_url":"https://api.github.com/repos/hichxm/framework/pulls{/number}","milestones_url":"https://api.github.com/repos/hichxm/framework/milestones{/number}","notifications_url":"https://api.github.com/repos/hichxm/framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hichxm/framework/labels{/name}","releases_url":"https://api.github.com/repos/hichxm/framework/releases{/id}","deployments_url":"https://api.github.com/repos/hichxm/framework/deployments","created_at":"2018-11-01T11:39:05Z","updated_at":"2018-11-01T11:39:13Z","pushed_at":"2018-11-01T14:20:24Z","git_url":"git://github.com/hichxm/framework.git","ssh_url":"git@github.com:hichxm/framework.git","clone_url":"https://github.com/hichxm/framework.git","svn_url":"https://github.com/hichxm/framework","homepage":"http://laravel.com","size":37500,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"5.7"}},"base":{"label":"laravel:5.7","ref":"5.7","sha":"8699a622a31a139d4a6094973f169af7a0806f91","user":{"login":"laravel","id":958072,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk1ODA3Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/958072?v=4","gravatar_id":"","url":"https://api.github.com/users/laravel","html_url":"https://github.com/laravel","followers_url":"https://api.github.com/users/laravel/followers","following_url":"https://api.github.com/users/laravel/following{/other_user}","gists_url":"https://api.github.com/users/laravel/gists{/gist_id}","starred_url":"https://api.github.com/users/laravel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laravel/subscriptions","organizations_url":"https://api.github.com/users/laravel/orgs","repos_url":"https://api.github.com/users/laravel/repos","events_url":"https://api.github.com/users/laravel/events{/privacy}","received_events_url":"https://api.github.com/users/laravel/received_events","type":"Organization","site_admin":false},"repo":{"id":7548986,"node_id":"MDEwOlJlcG9zaXRvcnk3NTQ4OTg2","name":"framework","full_name":"laravel/framework","private":false,"owner":{"login":"laravel","id":958072,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk1ODA3Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/958072?v=4","gravatar_id":"","url":"https://api.github.com/users/laravel","html_url":"https://github.com/laravel","followers_url":"https://api.github.com/users/laravel/followers","following_url":"https://api.github.com/users/laravel/following{/other_user}","gists_url":"https://api.github.com/users/laravel/gists{/gist_id}","starred_url":"https://api.github.com/users/laravel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laravel/subscriptions","organizations_url":"https://api.github.com/users/laravel/orgs","repos_url":"https://api.github.com/users/laravel/repos","events_url":"https://api.github.com/users/laravel/events{/privacy}","received_events_url":"https://api.github.com/users/laravel/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/laravel/framework","description":null,"fork":false,"url":"https://api.github.com/repos/laravel/framework","forks_url":"https://api.github.com/repos/laravel/framework/forks","keys_url":"https://api.github.com/repos/laravel/framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/laravel/framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/laravel/framework/teams","hooks_url":"https://api.github.com/repos/laravel/framework/hooks","issue_events_url":"https://api.github.com/repos/laravel/framework/issues/events{/number}","events_url":"https://api.github.com/repos/laravel/framework/events","assignees_url":"https://api.github.com/repos/laravel/framework/assignees{/user}","branches_url":"https://api.github.com/repos/laravel/framework/branches{/branch}","tags_url":"https://api.github.com/repos/laravel/framework/tags","blobs_url":"https://api.github.com/repos/laravel/framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/laravel/framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/laravel/framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/laravel/framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/laravel/framework/statuses/{sha}","languages_url":"https://api.github.com/repos/laravel/framework/languages","stargazers_url":"https://api.github.com/repos/laravel/framework/stargazers","contributors_url":"https://api.github.com/repos/laravel/framework/contributors","subscribers_url":"https://api.github.com/repos/laravel/framework/subscribers","subscription_url":"https://api.github.com/repos/laravel/framework/subscription","commits_url":"https://api.github.com/repos/laravel/framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/laravel/framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/laravel/framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/laravel/framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/laravel/framework/contents/{+path}","compare_url":"https://api.github.com/repos/laravel/framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/laravel/framework/merges","archive_url":"https://api.github.com/repos/laravel/framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/laravel/framework/downloads","issues_url":"https://api.github.com/repos/laravel/framework/issues{/number}","pulls_url":"https://api.github.com/repos/laravel/framework/pulls{/number}","milestones_url":"https://api.github.com/repos/laravel/framework/milestones{/number}","notifications_url":"https://api.github.com/repos/laravel/framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/laravel/framework/labels{/name}","releases_url":"https://api.github.com/repos/laravel/framework/releases{/id}","deployments_url":"https://api.github.com/repos/laravel/framework/deployments","created_at":"2013-01-10T21:27:28Z","updated_at":"2018-11-01T21:51:16Z","pushed_at":"2018-11-01T22:04:32Z","git_url":"git://github.com/laravel/framework.git","ssh_url":"git@github.com:laravel/framework.git","clone_url":"https://github.com/laravel/framework.git","svn_url":"https://github.com/laravel/framework","homepage":"http://laravel.com","size":37133,"stargazers_count":14583,"watchers_count":14583,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5939,"mirror_url":null,"archived":false,"open_issues_count":197,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":5939,"open_issues":197,"watchers":14583,"default_branch":"5.7"}},"_links":{"self":{"href":"https://api.github.com/repos/laravel/framework/pulls/26344"},"html":{"href":"https://github.com/laravel/framework/pull/26344"},"issue":{"href":"https://api.github.com/repos/laravel/framework/issues/26344"},"comments":{"href":"https://api.github.com/repos/laravel/framework/issues/26344/comments"},"review_comments":{"href":"https://api.github.com/repos/laravel/framework/pulls/26344/comments"},"review_comment":{"href":"https://api.github.com/repos/laravel/framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/laravel/framework/pulls/26344/commits"},"statuses":{"href":"https://api.github.com/repos/laravel/framework/statuses/39d64c5233b01f736a3eb8ee42dedc2c858e14a0"}},"author_association":"NONE"}}
{"actor":{"display_login":"hichxm"}}