{"action":"created","issue":{"url":"https://api.github.com/repos/mcamara/laravel-localization/issues/330","repository_url":"https://api.github.com/repos/mcamara/laravel-localization","labels_url":"https://api.github.com/repos/mcamara/laravel-localization/issues/330/labels{/name}","comments_url":"https://api.github.com/repos/mcamara/laravel-localization/issues/330/comments","events_url":"https://api.github.com/repos/mcamara/laravel-localization/issues/330/events","html_url":"https://github.com/mcamara/laravel-localization/issues/330","id":162182160,"number":330,"title":"LaravelLocalization class does not exists on runtime","user":{"login":"Qathom","id":5703536,"avatar_url":"https://avatars.githubusercontent.com/u/5703536?v=3","gravatar_id":"","url":"https://api.github.com/users/Qathom","html_url":"https://github.com/Qathom","followers_url":"https://api.github.com/users/Qathom/followers","following_url":"https://api.github.com/users/Qathom/following{/other_user}","gists_url":"https://api.github.com/users/Qathom/gists{/gist_id}","starred_url":"https://api.github.com/users/Qathom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Qathom/subscriptions","organizations_url":"https://api.github.com/users/Qathom/orgs","repos_url":"https://api.github.com/users/Qathom/repos","events_url":"https://api.github.com/users/Qathom/events{/privacy}","received_events_url":"https://api.github.com/users/Qathom/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-06-24T16:21:18Z","updated_at":"2017-01-25T14:22:43Z","closed_at":null,"body":"Hello,\n\nFirst of all, thank you for this plugin!\nWhen using `composer install`, then `php artisan optimize`, the following error appears: `LaravelLocalization class not found` and the app cannot be launched.\n\n**Code to reproduce this issue:**\n\n``` php\nRoute::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => [ 'localeSessionRedirect', 'localizationRedirect' ]], function () {\n    Route::get('/page', 'Pages\\PageController@index')->name('index');\n});\n```\n\n**WORKAROUND**\n\nBy adding a class alias and by recreating the LaravelLocalization configuration, it works.\n\n``` php\nclass_alias('Mcamara\\LaravelLocalization\\Facades\\LaravelLocalization', 'LaravelLocalization');\nconfig([\n    'laravellocalization.supportedLocales' => [\n        'ca'  => array( 'name' => 'Catalan', 'script' => 'Latn', 'native' => 'català' ),\n        'en'  => array( 'name' => 'English', 'script' => 'Latn', 'native' => 'English' ),\n    ],\n    'laravellocalization.useAcceptLanguageHeader' => true,\n    'laravellocalization.hideDefaultLocaleInURL' => true\n]);\n\n$this->app['laravellocalization'] = $this->app->share(\n    function () {\n        return new Mcamara\\LaravelLocalization\\LaravelLocalization();\n    }\n);\n```\n"},"comment":{"url":"https://api.github.com/repos/mcamara/laravel-localization/issues/comments/275119988","html_url":"https://github.com/mcamara/laravel-localization/issues/330#issuecomment-275119988","issue_url":"https://api.github.com/repos/mcamara/laravel-localization/issues/330","id":275119988,"user":{"login":"vincentdenaes","id":14006783,"avatar_url":"https://avatars.githubusercontent.com/u/14006783?v=3","gravatar_id":"","url":"https://api.github.com/users/vincentdenaes","html_url":"https://github.com/vincentdenaes","followers_url":"https://api.github.com/users/vincentdenaes/followers","following_url":"https://api.github.com/users/vincentdenaes/following{/other_user}","gists_url":"https://api.github.com/users/vincentdenaes/gists{/gist_id}","starred_url":"https://api.github.com/users/vincentdenaes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincentdenaes/subscriptions","organizations_url":"https://api.github.com/users/vincentdenaes/orgs","repos_url":"https://api.github.com/users/vincentdenaes/repos","events_url":"https://api.github.com/users/vincentdenaes/events{/privacy}","received_events_url":"https://api.github.com/users/vincentdenaes/received_events","type":"User","site_admin":false},"created_at":"2017-01-25T14:22:43Z","updated_at":"2017-01-25T14:22:43Z","body":"Instead 'WorkAround' I just delete bootstrap cache and it was ok"}}
{"actor":{"display_login":"vincentdenaes"}}