@terrence
To redirect to another page in Laravel, you can use the redirect()
method provided by the Laravel framework.
Here's how you can redirect to another page in Laravel:
1
|
return redirect('/another-page'); |
In the above example, we are redirecting to the '/another-page' URL. You can replace '/another-page' with the desired URL.
1
|
return redirect()->route('route.name'); |
Replace 'route.name'
with the name of the desired route.
1
|
return back(); |
1
|
return redirect('/another-page')->with('message', 'Redirected Successfully'); |
In this case, the flash message with the key 'message'
and value 'Redirected Successfully'
will be available on the redirected page.
Be sure to return the redirect response from your controller method.