{{-- ============================================================ Recursive Menu Item Component Usage: @include('filament-menu-manager::components.menu-item', compact('item','depth')) ============================================================ --}}
{{-- Item Card --}}
{{-- Drag Handle --}} {{-- Body --}}
{{ $item['title'] }} {{ $item['type'] ?? 'özel' }} @if(!$item['enabled']) Gizli @endif
{{ $item['url'] ?? '#' }}
{{-- Action Buttons --}}
{{-- Move Up --}} {{-- Move Down --}} {{-- Indent (→) --}} @php $maxDepth = config('filament-menu-manager.max_depth'); $canIndent = true; if ($maxDepth !== null) { // Recursive helper to find max depth of this item's children $getSubtreeDepth = function($items) use (&$getSubtreeDepth) { $max = 0; foreach ($items as $item) { $d = 1 + $getSubtreeDepth($item['children'] ?? []); if ($d > $max) $max = $d; } return $max; }; $subtreeDepth = $getSubtreeDepth($item['children'] ?? []); if (($depth + 1 + $subtreeDepth) > $maxDepth) { $canIndent = false; } } @endphp @if($canIndent && $index > 0) @endif {{-- Outdent (←) --}} @if($depth > 0) @endif {{-- Toggle visibility --}} {{-- Edit --}} {{-- Delete --}}
{{-- Inline Edit Form --}} @if(isset($editingItemId) && $editingItemId == $item['id'])
Title
URL
Açılış Türü
@endif {{-- Children (recursive) --}} @if(!empty($item['children']))
@foreach($item['children'] as $childIdx => $child) @include('filament-menu-manager::components.menu-item', ['item' => $child, 'depth' => $depth + 1, 'index' => $childIdx]) @endforeach
@else {{-- Empty sortable drop zone for nesting --}}
@endif