I have a database that contains project_development and developer. I want to make an edit form for the project_development that has select with option from developer table. when the data matches, the current option will be selected. It works fine on other select without the foreach loop statement.
<select class="form-control" id="project" name="project">
@foreach ($developer as $dev)
@if ($dev->id == $project_development->developer)
<option value="{{ $dev->id }}" selected>{{ $dev->name }} (Current)</option>
@else
<option value="{{ $dev->id }}">{{ $dev->name }}</option>
@endif
@endforeach
</select>
my other select object without looping.
Thank you for your attention.
You can do: