How to show selected value from database in dropdown using Laravel

How to show selected value from database in dropdown using Laravel?

<select name="state" id="state" class="form-control form_cont" required>
   <option selected="true" disabled="disabled">Select State</option>
   @foreach($city as $cities)
   <option value="{{ $cities->cityState }}" {{$customerData->state == $cities->cityState  ? 'selected' : ''}}>{{ $cities->cityState }}</option>
   @endforeach
</select>
Leave a Comment