0

I have below code

<option value="{{ old('city',$user->city) }}" selected></option>

How to know old() is empty here ?

abu abu
  • 6,599
  • 19
  • 74
  • 131

1 Answers1

1

You can check the value, if value matches mark selected.

<option value="London" {{ old('city', $user->city) == 'London' ? 'selected' : '' }}></option>
Saran
  • 1,435
  • 11
  • 11