@php use Illuminate\Support\Facades\Storage; use Illuminate\Support\Str; /** @var \App\Models\MenuItem $item */ $depth = isset($depth) ? (int)$depth : 0; $path = $path ?? [$item->title]; $kids = $item->children; $hasKids = $kids->count() > 0; // payload pentru modal $editPayload = [ 'id' => $item->id, 'type' => $item->type, 'title' => $item->title ?? $item->label ?? '', 'label' => $item->label ?? $item->title ?? '', 'url' => $item->url ?? '', 'target' => $item->target ?? '_self', 'css_class' => $item->css_class ?? '', 'is_active' => (bool) ($item->is_active ?? $item->active ?? false), 'button_text' => $item->button_text ?? '', 'button_url' => $item->button_url ?? '', 'category_id' => $item->category_id ?? '', 'image_url' => $item->image_path ? Storage::disk('public')->url($item->image_path) : null, 'parent_id' => $item->parent_id, 'position' => $item->position, ]; // atribute pentru filtrare/căutare $dataTitle = Str::lower($item->title ?? ''); $dataType = $item->type; $dataCat = $item->type==='category' ? ('cat#'.$item->category_id) : ''; @endphp