Reputation: 379
I need to check if Laravel is redirected from failed validation.
If so then I will use the old()
function, otherwise I will show data from model.
I don't want to check for every input like old('name')
. I just need a flag.
Upvotes: 0
Views: 2711
Reputation: 973
In Blade for example:
@if ($errors->any())
{{ old(ˋvalueˋ) }}
@endif
or
{{ old('value', $model->value) }}
Upvotes: 1