I just installed Mcamara\LaravelLocalization following the documentation but I get an error Call to undefined method Mcamara\LaravelLocalization\Facades\LaravelLocalization::setLocale()
The error comes from the web.php routes file of my package. If I use the same code in my main routes file it works perfect. All other routes of my package work, only those I want to localize don't.
Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['web', 'localeSessionRedirect', 'localizationRedirect', 'localeViewPath']], function() {
Route::get('/{page}', 'FrontPagesController@index');
});
I found on stackoverflow that this could be because locale in config/app.php
is not set but in my case it is set to en
.
Can someone help me?