Closed chmoelders closed 4 years ago
Same problem here. All routes with MULTILINGUAL_ROUTES_PREFIX_DEFAULT=true
go to 404
.
I started again with last version and it worked. First I removed the package from vendor
and next, I followed the installation:
composer require chinleung/laravel-multilingual-routes
app/Http/Kernel
the line \ChinLeung\MultilingualRoutes\DetectRequestLocale::class
php artisan vendor:publish --provider="ChinLeung\MultilingualRoutes\MultilingualRoutesServiceProvider" --tag="config"
php artisan vendor:publish --provider="ChinLeung\LaravelLocales\LaravelLocalesServiceProvider" --tag="config"
config/laravel-multilingual-routes.php
change lines for 'default' => env('MULTILINGUAL_ROUTES_DEFAULT_LOCALE', config('app.locale')),
and 'prefix_default' => env('MULTILINGUAL_ROUTES_PREFIX_DEFAULT', true)
config/locales.php
add new language in arrayroutes/web.php
add Route::redirect('/', locale());
in the top of file@chinleung thanks for the fast reply and the fix
Hi! The package looks pretty cool but I can't get it work.
The multilingual route "en/" doesn't work. Each GET request to http://localhost/en results in a 404. A GET request to http://localhost/ works fine.
To Reproduce Laravel v6.12.0 (fresh and clean) Problem occurs on apache and nginx. First i suspected a problem with the mod_rewrite in apache. I've tried laravel-multilingual-routes v1.5.0 and 2.0.0
web.php
Config values
Expected behavior Each route should return its URI
Result of route:list:
Additional With
MULTILINGUAL_ROUTES_PREFIX_DEFAULT=true
every route leads to a 404.