{"action":"opened","number":12670,"pull_request":{"url":"https://api.github.com/repos/laravel/framework/pulls/12670","id":62073121,"html_url":"https://github.com/laravel/framework/pull/12670","diff_url":"https://github.com/laravel/framework/pull/12670.diff","patch_url":"https://github.com/laravel/framework/pull/12670.patch","issue_url":"https://api.github.com/repos/laravel/framework/issues/12670","number":12670,"state":"open","locked":false,"title":"Add isLocale() method","user":{"login":"juukie","id":2678657,"avatar_url":"https://avatars.githubusercontent.com/u/2678657?v=3","gravatar_id":"","url":"https://api.github.com/users/juukie","html_url":"https://github.com/juukie","followers_url":"https://api.github.com/users/juukie/followers","following_url":"https://api.github.com/users/juukie/following{/other_user}","gists_url":"https://api.github.com/users/juukie/gists{/gist_id}","starred_url":"https://api.github.com/users/juukie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juukie/subscriptions","organizations_url":"https://api.github.com/users/juukie/orgs","repos_url":"https://api.github.com/users/juukie/repos","events_url":"https://api.github.com/users/juukie/events{/privacy}","received_events_url":"https://api.github.com/users/juukie/received_events","type":"User","site_admin":false},"body":"I find myself doing `if('en' === app()->getLocale()){}` a lot and therefore I've written a helper myself.\r\n```\r\n/**\r\n * @return bool\r\n */\r\nfunction is_locale($locale)\r\n{\r\n    return app()->getLocale() === $locale;\r\n}\r\n```\r\nWhy still send a PR?\r\n- There are similar environment checks (`app()->environment('staging')` and `app()->isLocal()`)\r\n- I think more users would like this helper\r\n","created_at":"2016-03-08T13:49:21Z","updated_at":"2016-03-08T13:49:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/laravel/framework/pulls/12670/commits","review_comments_url":"https://api.github.com/repos/laravel/framework/pulls/12670/comments","review_comment_url":"https://api.github.com/repos/laravel/framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/laravel/framework/issues/12670/comments","statuses_url":"https://api.github.com/repos/laravel/framework/statuses/7bc0ca887b5587f8d0e03f399fce1c44089ee4fc","head":{"label":"juukie:feature-is-locale","ref":"feature-is-locale","sha":"7bc0ca887b5587f8d0e03f399fce1c44089ee4fc","user":{"login":"juukie","id":2678657,"avatar_url":"https://avatars.githubusercontent.com/u/2678657?v=3","gravatar_id":"","url":"https://api.github.com/users/juukie","html_url":"https://github.com/juukie","followers_url":"https://api.github.com/users/juukie/followers","following_url":"https://api.github.com/users/juukie/following{/other_user}","gists_url":"https://api.github.com/users/juukie/gists{/gist_id}","starred_url":"https://api.github.com/users/juukie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juukie/subscriptions","organizations_url":"https://api.github.com/users/juukie/orgs","repos_url":"https://api.github.com/users/juukie/repos","events_url":"https://api.github.com/users/juukie/events{/privacy}","received_events_url":"https://api.github.com/users/juukie/received_events","type":"User","site_admin":false},"repo":{"id":32810312,"name":"framework","full_name":"juukie/framework","owner":{"login":"juukie","id":2678657,"avatar_url":"https://avatars.githubusercontent.com/u/2678657?v=3","gravatar_id":"","url":"https://api.github.com/users/juukie","html_url":"https://github.com/juukie","followers_url":"https://api.github.com/users/juukie/followers","following_url":"https://api.github.com/users/juukie/following{/other_user}","gists_url":"https://api.github.com/users/juukie/gists{/gist_id}","starred_url":"https://api.github.com/users/juukie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juukie/subscriptions","organizations_url":"https://api.github.com/users/juukie/orgs","repos_url":"https://api.github.com/users/juukie/repos","events_url":"https://api.github.com/users/juukie/events{/privacy}","received_events_url":"https://api.github.com/users/juukie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/juukie/framework","description":"","fork":true,"url":"https://api.github.com/repos/juukie/framework","forks_url":"https://api.github.com/repos/juukie/framework/forks","keys_url":"https://api.github.com/repos/juukie/framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juukie/framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juukie/framework/teams","hooks_url":"https://api.github.com/repos/juukie/framework/hooks","issue_events_url":"https://api.github.com/repos/juukie/framework/issues/events{/number}","events_url":"https://api.github.com/repos/juukie/framework/events","assignees_url":"https://api.github.com/repos/juukie/framework/assignees{/user}","branches_url":"https://api.github.com/repos/juukie/framework/branches{/branch}","tags_url":"https://api.github.com/repos/juukie/framework/tags","blobs_url":"https://api.github.com/repos/juukie/framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juukie/framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juukie/framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/juukie/framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juukie/framework/statuses/{sha}","languages_url":"https://api.github.com/repos/juukie/framework/languages","stargazers_url":"https://api.github.com/repos/juukie/framework/stargazers","contributors_url":"https://api.github.com/repos/juukie/framework/contributors","subscribers_url":"https://api.github.com/repos/juukie/framework/subscribers","subscription_url":"https://api.github.com/repos/juukie/framework/subscription","commits_url":"https://api.github.com/repos/juukie/framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/juukie/framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/juukie/framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/juukie/framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/juukie/framework/contents/{+path}","compare_url":"https://api.github.com/repos/juukie/framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juukie/framework/merges","archive_url":"https://api.github.com/repos/juukie/framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juukie/framework/downloads","issues_url":"https://api.github.com/repos/juukie/framework/issues{/number}","pulls_url":"https://api.github.com/repos/juukie/framework/pulls{/number}","milestones_url":"https://api.github.com/repos/juukie/framework/milestones{/number}","notifications_url":"https://api.github.com/repos/juukie/framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juukie/framework/labels{/name}","releases_url":"https://api.github.com/repos/juukie/framework/releases{/id}","deployments_url":"https://api.github.com/repos/juukie/framework/deployments","created_at":"2015-03-24T16:19:44Z","updated_at":"2015-03-24T16:19:48Z","pushed_at":"2016-03-08T13:43:37Z","git_url":"git://github.com/juukie/framework.git","ssh_url":"git@github.com:juukie/framework.git","clone_url":"https://github.com/juukie/framework.git","svn_url":"https://github.com/juukie/framework","homepage":"http://laravel.com","size":14810,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"5.0"}},"base":{"label":"laravel:5.2","ref":"5.2","sha":"3f45e9b25bd9c01f6205da3e05ae6eea9b3f4a0e","user":{"login":"laravel","id":958072,"avatar_url":"https://avatars.githubusercontent.com/u/958072?v=3","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,"name":"framework","full_name":"laravel/framework","owner":{"login":"laravel","id":958072,"avatar_url":"https://avatars.githubusercontent.com/u/958072?v=3","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},"private":false,"html_url":"https://github.com/laravel/framework","description":"","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":"2016-03-08T12:18:20Z","pushed_at":"2016-03-08T13:39:01Z","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":35084,"stargazers_count":4899,"watchers_count":4899,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2834,"mirror_url":null,"open_issues_count":119,"forks":2834,"open_issues":119,"watchers":4899,"default_branch":"5.2"}},"_links":{"self":{"href":"https://api.github.com/repos/laravel/framework/pulls/12670"},"html":{"href":"https://github.com/laravel/framework/pull/12670"},"issue":{"href":"https://api.github.com/repos/laravel/framework/issues/12670"},"comments":{"href":"https://api.github.com/repos/laravel/framework/issues/12670/comments"},"review_comments":{"href":"https://api.github.com/repos/laravel/framework/pulls/12670/comments"},"review_comment":{"href":"https://api.github.com/repos/laravel/framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/laravel/framework/pulls/12670/commits"},"statuses":{"href":"https://api.github.com/repos/laravel/framework/statuses/7bc0ca887b5587f8d0e03f399fce1c44089ee4fc"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":11,"deletions":0,"changed_files":1}}