laravel-localization icon indicating copy to clipboard operation
laravel-localization copied to clipboard

I want localeSessionRedirect to redirect to localized path but the locale as the second route param.

Open Mrbeyond opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe. I need to refactor my laravel app to have dynamic company slug to prefix all the routes. This would serve as identifier for each branch and to segrate users for each branch because the distinct branch slug serves as url for the branches . This is working fine.

The issue now is with the localization, \Mcamara\LaravelLocalization\Middleware\LocaleSessionRedirect::class is changing the route url by preeceding the url path with en e.g if the path is /dashbord it would change it to en/dashboard which was the default behaviour but I want the locale to come after the branch slug like /branch/en/dashboard rather it's changing it to /en/branch/dashboard.

Describe the solution you'd like I want to be able change the index or position of the locale redirect on the route param: e.g to be able to set the redirect to any of this /branch/en/dashboard, /branch/dashboard/en or /en/branch/dashboard.

Describe alternatives you've considered Nothing yet.

Additional context Add any other context or screenshots about the feature request here.

Mrbeyond avatar Jun 07 '23 13:06 Mrbeyond