Populate form input select (Laravel)

this is for select option (dropdown)



<select name="province" id="province" class="form-control">
@foreach(config('constants.master_province') as $key => $value)
<option value="{{ $key }}" {{ (old('province', (!empty($vendor->province)) ? $vendor->province : '') == $key) ? 'selected="selected"' : '' }}>{{ $value }}</option>
@endforeach
</select>


and below for input


 
<input type="text" name="url" id="url" class="form-control" value="{{ old('url', (!empty($vendor->url)) ? $vendor->url : '') }}">

Advertisements