我尝试显示输入到后置位置中的数据,以显示在每个位置上,如果该数据在那里,则该位置的颜色将为绿色>
<div class="col-12 pl-0">
<div class="form-group">
<label for="location">Location</label>
<br>
<div>
@foreach ($locations as $location)
@foreach ($postlog->postlocationget as $postlocation)
@if($location->id == 1)
@else
<div style="cursor: pointer;" class="p-2 my-1 badge badge-pill @if($postlocation->location == $location->id) badge-success @else badge-info @endif" id="badgeloc{{$location->id}}">{{$location->location}} </div>
<input hidden="hidden" type="checkbox" id="checkloc{{$location->id}}">
@endif
@endforeach
@endforeach
</div>
</div>
</div>