Sometime you need to pass extra parameter as query string in Laravel route that is not part of a route parameters so don't worry, you can pass everything as query string in route that is defined in route parameter.
Simple Redirect to Named Routesreturn redirect()->route('dashboard');Redirect named route with query string
- return redirect()->route('dashboard',['product_id'=>1])
- ->with('message','Welcome to ExpertPHP.');
Here i am passing message
variable as Flashed Session Data which you can use in your view to display message.
You can also redirect to controller action, for this pass the controller name with action.
return redirect()->action('UserController@dashboard');Redirect to another URL
return redirect('user/dashboard');