Closed thusfar7 closed 8 years ago
What is your default locale inside 'app.locale' ?
Can you use this route for 'settings' instead and see if it solves your issue :
$router->localizedGroup(function($router) {
$router->group(['middleware' => 'web'], function ($router) {
// ...
// Settings Dashboard...
$router->get('/settings', 'Settings\DashboardController@show');
// ...
Honestly, i never used spark and i don't know if it's gonna effect your localization or not.
UPDATE:
web
middleware?I move web middleware before Localization middlewares. It seems that solved the problem. I guess when web middleware is set after localization middlewares, localization doesnt persist.
I dont know if that is general problem or just in my case, but it is worth mentioning.
So I have two locales: en and hr.
I have to routes files. One in /app/Http/routes.php
and other one in /vendor/laravel/spark/src/Htpp/routes.php (assigns routes to $router variable)
Now when I got to /dashboard which is defined in original Laravel routes.php like this
and then it takes me to /en/dashboard or /hr/dasdashboard. That's great. And there I switch to /en/dashboard
Then I go to '/settings' route. No locale prefixed and it always takes me to /hr/settings but I was on /en/dashboard.
Why does it change locale for no reason? That route '/settings' is defined in Spark's routes.php
Also my localization.php
So why Locale /en doesnt persist and why is it always changed to hr???