<div class="tab-content">
@foreach($groups as $group)
<div role="tabpanel" class="tab-pane" id="grp-{{ $group->id }}">
@foreach($ingreds as $ingred)
@if($ingred->id_ingredient_group==$group->id)
<label>
<input type="checkbox" name="ingredients[]" @foreach($item->ingredients as $ingredient) @if($ingred->id==$ingredient->data->id) {{"checked"}} @endif @endforeach value="{{$ingred->id}}"> {{ $ingred->name}}
</label>
@endif
@endforeach
</div>
@endforeach
</div>
我希望"$ingred->id==$ingredient->data->id"
比我的复选框更有效,但不会发生。