@foreach($items as $val)
@if(count($val->children_tree) > 0) @else @endif {{ $val->name }} {{-- Show code inline on mobile --}} @if($val->code) {{ $val->code }} @endif
{{ $val->code ?? '—' }} {{ $val->sort_order }} {{ $val->is_active ? 'Active' : 'Inactive' }} @php $collectDescendantIds = function ($node) use (&$collectDescendantIds) { $ids = []; foreach ($node->children_tree as $child) { $ids[] = $child->id; $ids = array_merge($ids, $collectDescendantIds($child)); } return $ids; }; $descendantIds = $collectDescendantIds($val); @endphp
@if(count($val->children_tree) === 0)
@csrf @method('DELETE')
@endif
@if(count($val->children_tree) > 0) @include('accounting.dimensions._value_tree', [ 'items' => $val->children_tree, 'level' => $level + 1, 'dimension' => $dimension, 'allValues' => $allValues, ]) @endif @endforeach