I have this code foreach loop it will get the first data form my table every iteration on the next output. I would like to have a guidance on this
<select class="selectpicker form-control" data-live-search="true">
@foreach ($IncidentTypes as $Incident)
<optgroup label="{{ $Incident->incident_type ." ". $Incident->id }}">
@foreach ($Incident->IncidentSubType as $subTypes)
<option>
{{ $subTypes->incident_name . " " . $subTypes->incident_type_id }}
</option>
</optgroup>
@endforeach
@endforeach
</select>