I'm working with Laravel 5.8 and I wanted to add value old()
so that when user fills out form and the form gets refreshes (if any error occured), the old value appears as value of input:
<div class="form-group">
<label for="">Postal Code</label>
<span class='text-danger'>*</span>
<input type="text" class="form-control" name="post_code" value="{{ old('post_code',$member->mbr_post_code??null) }}">
</div>
But now the problem is, it does not show the Old value of user however the form input is filled once.
So how to solve this issue?
CodePudding user response:
You should use only {{ old('post_code') }} or you can update the code in this way old('post_code',$member->mbr_post_code ? $member->mbr_post_code : '')
This is happening for NULL
.