1@foreach($services as $service)
2 @if (old('category') == $service->id)
3 <option value="{{ $service->id }}" selected>{{ $service->title }}</option>
4 @else
5 <option value="{{ $service->id }}">{{ $service->title }}</option>
6 @endif
7@endforeach
1{{ old('title') == '1' ? 'selected' : '' }}
2<div class="form-group col-md-6">
3<label>Nationality {{$profiledata->nationality}}</label>
4 <select id="nationality" required="" name="nationality" class="form-control">
5 <option value="">--Select--</option>
6 <option {{ ($profiledata->nationality) == 'United State' ? 'selected' : '' }} value="United State">United State</option>
7 <option {{ ($profiledata->nationality) == 'India' ? 'selected' : '' }} value="India">India</option>
8 <option {{ ($profiledata->nationality) == 'Canada' ? 'selected' : '' }} value="Canada">Canada</option>
9 </select>
10</div>
1<option value="{{ $key }}" {{ (Input::old("title") == $key ? "selected":"") }}>{{ $val }}</option>
2
1# Populate Old value with default value selected
2# Laravel 8
3<select name="dial_code" id="dial_code">
4@foreach($countries as $c)
5 <option value="{{$c->phone_code}}" title="{{$c->name}}" {{old('dial_code', 966) == $c->phone_code ? 'selected' : ''}}>{{$c->iso2}} ({{$c->phone_code}})</option>
6@endforeach
7</select>