chinleung / laravel-multilingual-routes

A package to handle multilingual routes in your Laravel application.
https://github.com/chinleung/laravel-multilingual-routes-demo
MIT License
394 stars 26 forks source link

Support root routes in route groups #81

Closed fyrts closed 5 months ago

fyrts commented 6 months ago

Currently, the following route definition always drops the locale prefix:

Route::prefix('prefix')->group(function () {
    Route::multilingual('/')->name('index');
});

localized_route('index') now always results in /prefix instead of /{locale}/prefix when applicable (regardless of settings).

I've modified MultilingualRegistrar::generatePrefixForLocale so that it doesn't drop the locale prefix when a group prefix applies.

chinleung commented 5 months ago

Sorry for the delay and thanks for the fix @fyrts!