Můžete zkontrolovat svůj foreach
pokud je hodnota nameOfDepartment
odpovídat té od vašeho uživatele.
<div class="form-group">
<label class="col-md-12">Department</label>
<div class="col-md-12">
<select class="custom-select form-control col-md-11" id="department" name="department">
@foreach($listDepartment as $departmentList)
@if ($profile->personal_profile['department'] == $departmentList->nameOfDepartment)
<option value="{{$departmentList->nameOfDepartment}}" selected="selected">{{$departmentList->nameOfDepartment}}</option>
@else
<option value="{{$departmentList->nameOfDepartment}}">{{$departmentList->nameOfDepartment}}</option>
@endif
@endforeach
</select>
</div>
</div>
Pro vaše druhé výběrové pole vytvořte pole se všemi možnými hodnotami ve vašem ovladači.
$interview = [
'' => '--- Select Interciew Mode ---',
'telephonic' => 'Telephonic',
'facetoface' => 'Face 2 face',
'skype' => 'Skype'
];
Poté můžete provést totéž, co jste vybrali dříve:
<select class="custom-select form-control col-md-12" name="mode" id="mode" required>
@foreach($interview as $key => $name)
@if ($profile->personal_profile['interview'] == $key)
<option value="{{ $key }}" selected="selected">{{ $name }}</option>
@else
<option value="{{ $key }}">{{ $name }}</option>
@endif
@endforeach
</select>