Laravel route redirect not working

Updated at 09-Aug-2021, By samar

Laravel route redirect not working

In this article, we will see how to solve "Laravel route redirect not working".

You can redirect to a route with the redirect helper method in Laravel. You can change the route name as per your requirements.
  • Redirect to login route in laravel

    return redirect()->route('login');
    
  • Redirect route with parameters

    return redirect()->route('profile', ['id' => 1]);
    

    You can use this code snippet to your controller's method after performing some tasks. It will redirect to the profile route with parameter (id) value 1.

Back to code snippet queries related laravel