Back

Problem with laravel 5.8


DanielS posted 2 weeks 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.

web.php:

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

controller:

``

public function lang($locale)
{
    App::setLocale($locale);
    session()->put('locale', $locale);
    
    return redirect()->back();
}

``

The problem occurs when changing the url param mydomain.com/lang/pl or en

The page is not redirecting properly with code 302.

thanks for you time and help.

Cameron replied 2 weeks ago

Have you cleared all caches and routes since the update ?

Pardeeptech replied 1 week 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.

https://www.cloudways.com/blog/install-laravel-on-server/

Sign in to participate in this thread!



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