Closed baminc closed 4 years ago
Hi @baminc,
You can add the following in your .env
file to prefix the default locale:
MULTILINGUAL_ROUTES_PREFIX_DEFAULT=true
Otherwise, you can publish the config and update the value of prefix_default
to true
.
After you've updated the config, the generate routes should prefix even the default locale, so you will have a /de
and a /en
route.
Then simply add the following to your routes/web.php
for the redirection:
Route::redirect('/', locale());
Also make sure you've updated to v1.4.3 because it was not prefixing the home page previously.
Thanks for the Fix!
It seems like its not possible to have the default route "/" redirect to a the default locale route.
For example my app has german "de" and english "en", german is default locale, the routes generated by:
Route::multilingual('/', 'MainController@index')->name('index');
only include "/" and "/en" but not "/de". Any way to force the routing to create a locale based route for all routes including the default route? And then also redirect "/" to "/LOCALE"?