Laravel: redirect from controller to named route with params in URL
In Laravel, you can redirect from a controller to a named route with URL parameters using the redirect()
helper function. The route()
helper function can be used to generate the URL for the named route, and you can pass any necessary parameters as arguments.
Here's an example:
return redirect()->route('routeName', ['param1' => 'value1', 'param2' => 'value2']);
You can also redirect to route with action
return redirect()->action('ControllerName@methodName', ['param1' => 'value1', 'param2' => 'value2']);