How to redirect back to form with input in Laravel
In your HTML you have to use
Like for a name validation, this will be-
value = {{ old('') }}
. Without using it, you can't get the value back because what session will store in their cache.Like for a name validation, this will be-
<input type="text" name="name" value="{{ old('name') }}" />
Now, you can get the value after submitting it if there is error with redirect.
return redirect()->back()->withInput();
for back only:
return back()->withInput();