Open giwrgos88 opened 7 years ago
I have a route with two segments, that calls a form for storing. I want in case of an error to return back to the page with the inputs.
Here is my route
$router->get([ 'as' => 'testingForm', 'uri' => '/testing/form/{parent_slug}/{child_slug}', 'uses' => __NAMESPACE__ . '\Http\Controllers\Testing\Testing@form' ]);
and if the input data are not valid I have this but is not working
if ($validator->fails()) { $url = (string) $request->server()['HTTP_REFERER']; return redirect_response($url)->with('__form_data', $request->all())->with('error', $validator->messages()); }
Laravel has this to redirect back return redirect()->back()->withInput();
return redirect()->back()->withInput();
Does anyone knows how i can redirect back to my custom route?
I have a route with two segments, that calls a form for storing. I want in case of an error to return back to the page with the inputs.
Here is my route
and if the input data are not valid I have this but is not working
Laravel has this to redirect back
return redirect()->back()->withInput();
Does anyone knows how i can redirect back to my custom route?