Redirect to another view from controller in laravel

Updated at 25-Aug-2021, By samar

Redirect to another view from controller in laravel

Through many examples, we will learn how to resolve the "Redirect to another view from controller in laravel".

You can redirect to two different views from the controller on the basis of condition. If the condition for the return to the specific view is true it will return to the view otherwise it will return to the another view.
  • Return to two different view on the basis of if condition

    if($conditionTrue){
        return view('dashboard');
    }
    return view('home');
    

Back to code snippet queries related laravel