It always calls return redirect()->back() for you.. I don't understand your question I guess
Apr 30, 2015
13
Level 37
Change redirection URL after ValidationException in Lumen
According to Lumen's docs:
However, if validation fails, an Illuminate\Contracts\Validation\ValidationException will be thrown. This exception is automatically caught and a redirect is generated to the user's previous location.
In my case, instead of redirecting back to where the form was fired, it sends me back to the root.
How do I make sure it redirects back? How can I change the URL if I ever need to?
Trying to avoid this (from the docs too):
$v = Validator::make($request->all(), [
'title' => 'required|unique|max:255',
'body' => 'required',
]);
if ($v->fails()) {
return redirect()->back()->withErrors($v->errors());
}
Please or to participate in this conversation.