@php $typeColors = ['warehouse'=>'#1B4F8A|#EBF3FB','zone'=>'#664d03|#fff3cd','rack'=>'#0a3622|#d1e7dd','bin'=>'#495057|#e9ecef']; @endphp @foreach($items as $wh) @php [$tfg,$tbg] = explode('|', $typeColors[$wh->type] ?? '#495057|#e9ecef'); @endphp
@if(count($wh->children_tree) > 0) @else @endif {{ $wh->name }}
{{ $wh->code ?? '—' }} {{ ucfirst($wh->type) }} {{ $wh->is_active ? 'Active' : 'Inactive' }}
@if(auth()->user()->hasPermission('inventory','edit')) @if(count($wh->children_tree) === 0)
@csrf @method('DELETE')
@endif @endif
@if(count($wh->children_tree) > 0) @include('inventory.warehouses._tree', ['items' => $wh->children_tree, 'level' => $level + 1]) @endif @endforeach @once @push('scripts') @endpush @endonce