Problem with laravel 5.8

DanielS posted 2 months ago

Hi, I have a problem and I am a newbie.

My code worked perfectly in laravel 5.7 but now in 5.8 an error occurs.


Route::get('lang/{locale}', '[email protected]')->where('locale', 'pl|en')->name('lang');



public function lang($locale)
    session()->put('locale', $locale);
    return redirect()->back();


The problem occurs when changing the url param or en

The page is not redirecting properly with code 302.

thanks for you time and help.

Cameron replied 2 months ago

Have you cleared all caches and routes since the update ?

Pardeeptech replied 2 months ago

I suggest you to check your route configuration file like your method name and Controller name , I also suggest you to follow this article steps if you like to upgrade Laravel 5.7 to 5.8.

Sign in to participate in this thread!

We'd like to thank these amazing companies for supporting us