In my view1 I have a post form, with the action to a post route.
The post function in the controller saves the request's data to a session and redirects to view2.
In that view I want to have a link to navigate back to view1 but with the form filled out.
For validation purposes, I already have old() in place.
I expected the follow to work, but the function does not exists on the route helper:
← <a href="{{ route('view1')->withInput() }}">Back</a>
Here is the controller:
public function view1()
{
return view('view1');
}
public function post_create(CreateRequest $request)
{
$request->session()->put('data', $request->all());
return redirect()->route('view2');
}
public function view2()
{
return view('view2', [
'data' => session('data'),
]);
}