chinleung / laravel-multilingual-routes

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

Support root routes in route groups #81

Closed fyrts closed 8 months ago

fyrts commented 8 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 8 months ago

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