I have below code
<option value="{{ old('city',$user->city) }}" selected></option>
How to know old()
is empty here ?
I have below code
<option value="{{ old('city',$user->city) }}" selected></option>
How to know old()
is empty here ?
You can check the value, if value matches mark selected.
<option value="London" {{ old('city', $user->city) == 'London' ? 'selected' : '' }}></option>