{"action":"created","issue":{"url":"https://api.github.com/repos/mcamara/laravel-localization/issues/308","repository_url":"https://api.github.com/repos/mcamara/laravel-localization","labels_url":"https://api.github.com/repos/mcamara/laravel-localization/issues/308/labels{/name}","comments_url":"https://api.github.com/repos/mcamara/laravel-localization/issues/308/comments","events_url":"https://api.github.com/repos/mcamara/laravel-localization/issues/308/events","html_url":"https://github.com/mcamara/laravel-localization/issues/308","id":139828120,"number":308,"title":"Caching routes","user":{"login":"mgarciadelojo","id":1866396,"avatar_url":"https://avatars.githubusercontent.com/u/1866396?v=3","gravatar_id":"","url":"https://api.github.com/users/mgarciadelojo","html_url":"https://github.com/mgarciadelojo","followers_url":"https://api.github.com/users/mgarciadelojo/followers","following_url":"https://api.github.com/users/mgarciadelojo/following{/other_user}","gists_url":"https://api.github.com/users/mgarciadelojo/gists{/gist_id}","starred_url":"https://api.github.com/users/mgarciadelojo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgarciadelojo/subscriptions","organizations_url":"https://api.github.com/users/mgarciadelojo/orgs","repos_url":"https://api.github.com/users/mgarciadelojo/repos","events_url":"https://api.github.com/users/mgarciadelojo/events{/privacy}","received_events_url":"https://api.github.com/users/mgarciadelojo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-03-10T09:07:31Z","updated_at":"2016-08-09T20:52:14Z","closed_at":null,"body":"Hi guys,\r\n\r\nIs there any plan for caching routes? If not, I offer my help in order to implement it. I noticed that response times are a lot higher when routes are not cached.\r\n\r\nBest regards,"},"comment":{"url":"https://api.github.com/repos/mcamara/laravel-localization/issues/comments/238687343","html_url":"https://github.com/mcamara/laravel-localization/issues/308#issuecomment-238687343","issue_url":"https://api.github.com/repos/mcamara/laravel-localization/issues/308","id":238687343,"user":{"login":"scorpionick","id":20443464,"avatar_url":"https://avatars.githubusercontent.com/u/20443464?v=3","gravatar_id":"","url":"https://api.github.com/users/scorpionick","html_url":"https://github.com/scorpionick","followers_url":"https://api.github.com/users/scorpionick/followers","following_url":"https://api.github.com/users/scorpionick/following{/other_user}","gists_url":"https://api.github.com/users/scorpionick/gists{/gist_id}","starred_url":"https://api.github.com/users/scorpionick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scorpionick/subscriptions","organizations_url":"https://api.github.com/users/scorpionick/orgs","repos_url":"https://api.github.com/users/scorpionick/repos","events_url":"https://api.github.com/users/scorpionick/events{/privacy}","received_events_url":"https://api.github.com/users/scorpionick/received_events","type":"User","site_admin":false},"created_at":"2016-08-09T20:52:14Z","updated_at":"2016-08-09T20:52:14Z","body":"I found a fix!!!!\r\n\r\n**routes.php**\r\n\r\n`foreach(LaravelLocalization::getSupportedLocales() as $language => $properties) {\r\nRoute::group(\r\n[\r\n  'as' => $language.\".\",\r\n  'middleware' => ['localeSessionRedirect', 'localizationRedirect'],\r\n  'prefix' => $language,\r\n],\r\nfunction () use ($language){\r\n\r\n...\r\n\r\n});\r\n}`\r\n\r\n**Controller.php**\r\n`class Controller extends BaseController\r\n{\r\n    use AuthorizesRequests, AuthorizesResources, DispatchesJobs, ValidatesRequests;\r\n    public function __construct()\r\n    {\r\n      \\LaravelLocalization::setLocale();\r\n    }\r\n}`\r\n\r\n**vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\helpers.php**\r\n\r\n`if (! function_exists('route')) {\r\n    /**\r\n     * Generate a URL to a named route.\r\n     *\r\n     * @param  string  $name\r\n     * @param  array   $parameters\r\n     * @param  bool    $absolute\r\n     * @return string\r\n     */\r\n    function route($name, $parameters = [], $absolute = true)\r\n    {\r\n        return app('url')->route(LaravelLocalization::getCurrentLocale().'.'.$name, $parameters, $absolute);\r\n    }\r\n}`\r\n\r\nAfterward php artisan route:cache  works like a charm! ENJOY!\r\n\r\n"}}
{"actor":{"display_login":"scorpionick"}}