return back();
or
return redirect(route('contact.form')); ... or whatever you name the route
eg
Route::get('/contact','ContactController@show')->name('contact.form');
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a simple form on a one page design. I have it displaying but I am not sure how to reroute it back to the contact form after sbumition. Below is my contactcontroller.
public function store(Request $request)
{
$contact = [];
$contact['firstname'] = $request->get('firstname');
$contact['lastname'] = $request->get('lastname');
$contact['email'] = $request->get('email');
$contact['phone'] = $request->get('phone');
$contact['msg'] = $request->get('msg');
flash('Your Message Has Been Sent! Someone Will Contact You Soon!')->success();
return redirect()->url('This is my question');
}
Please or to participate in this conversation.