Laravel Selected Dropdown Value When Edit
Hello,
I encountered a problem to display a data to recover from the BD,
<label>Wilaya</label>
<select type="text" name = "avocat_wilaya" class="form-control" required id="avocat_wilaya" class="form-control">
@foreach($group as $avocat)
<option value="{{$avocat['wilaya_avocat']}}" {{ $selectedvalue == $avocat['wilaya_avocat'] ? 'selected="selected"' : '' }}></option>
@endforeach
Thanks in advance,
try
@foreach($group as $avocat)
<div class="form-group col-md-6">
<label > Wilaya </label>
<select class="form-control" name = "avocat_wilaya" id="avocat_wilaya" >
<option selected>{{$avocat->example1}}</option>
<option selected>{{$avocat->examle2}}</option>
</select>
</div>
</div>
@endforeach
Hello,
Thank you for your reply,
and at the level of the controller code?
What?
<select ...>
@foreach($group as $avocat)
<option value="{{ $avocat['wilaya_avocat'] }}" {{ $selectedvalue == $avocat['wilaya_avocat'] ? 'selected' : '' }}>...</option>
@endforeach
Hello,
Thank you for the answer,
But I have the version laravel 7.30
Please or to participate in this conversation.