@foreach($items as $cat)
@if(count($cat->children_tree) > 0) @else @endif {{ $cat->name }}
{{ $cat->code ?? '—' }} {{ $cat->items_count ?? 0 }} {{ $cat->is_active ? 'Active' : 'Inactive' }}
@if(auth()->user()->hasPermission('inventory','edit')) @if(count($cat->children_tree) === 0 && ($cat->items_count ?? 0) === 0)
@csrf @method('DELETE')
@endif @endif
@if(count($cat->children_tree) > 0) @include('inventory.categories._tree', ['items' => $cat->children_tree, 'level' => $level + 1]) @endif @endforeach @once @push('scripts') @endpush @endonce