Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

0re1's avatar
Level 1

MCamara Localization Pack

Greetings,

I have tried to use MCamara laravel localization https://github.com/mcamara/laravel-localization but when I try to have some language persistence thanks to the middleware specified in the route group all my requests to insert anything into database are failing and redirecting me back. How could I fix this? Should I extract all non-get routes?

    Route::group(
    [
        'prefix' => LaravelLocalization::setLocale(),
        'middleware' => [ 'localeSessionRedirect', 'localizationRedirect' ]
    ],
    function()
    {
    ....// all my routes are in the function...
    }

Your help is much appreciated :)

0 likes
1 reply
0re1's avatar
0re1
OP
Best Answer
Level 1

I was using it probably in a wrong way as I have all the routes in the function. I then have tried similar arcanedev localization and the problems were the same. Then I have moved the non-get routes out of the group and then it worked. :)

Please or to participate in this conversation.