vendredi 2 août 2019

laravelLocalization transRoute() : how to remove locale prefix from url

I'm working on a website, which uses french at default language. I'm new on Laravel, and I have to continue the work of somebody else. I want the users to be able to switch the site in english. Everything works fine, unless, the 'en' prefix won't go from the url, even when I switch back to french.

Anyone ever had the same issue ?

Route::group(
    [
        'prefix' => LaravelLocalization::setLocale(),
        'middleware' => [ 'localeSessionRedirect', 'localizationRedirect', 'localize' ]
    ], function ()
    {

All the localized routes are in this Route::group



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire