How to redirect back to form with input in Laravel

In your HTML you have to use 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();

Popular posts from this blog

Ajax Toggle(on/off) on-click Update

Yii Framework In Update Time View Image In Form