@foreach($items as $cat)
<div class="cat-cb-item">
    <div class="form-check">
        <input class="form-check-input" type="checkbox"
               name="categories[]"
               value="{{ $cat->id }}"
               id="cat-cb-{{ $cat->id }}"
               {{ in_array($cat->id, $selected ?? []) ? 'checked' : '' }}>
        <label class="form-check-label" for="cat-cb-{{ $cat->id }}">
            @if($cat->icon)
                <i class="ti ti-{{ $cat->icon }} text-primary me-1"></i>
            @endif
            {{ $cat->name }}
        </label>
    </div>
    @if($cat->subCategories->isNotEmpty())
        <div class="cat-cb-children">
            @include('admin.products._category-checkboxes', [
                'items'    => $cat->subCategories,
                'selected' => $selected ?? [],
            ])
        </div>
    @endif
</div>
@endforeach
