{{-- Filament Tree View - Tree Node Include ======================================= Renders a single tree node with drag-and-drop support. This view is recursive - it includes itself to render children. Variables: - $record: Eloquent model instance - $depth: Current nesting level (0 = root) - $maxDepth: Maximum depth allowed - $livewire: The parent Livewire component --}} @php // Check if this node has children $hasChildren = isset($record->children) && count($record->children) > 0; // Get tree instance $tree = $livewire->getTree(); // Get and filter record actions for this record $recordActions = array_reduce( $tree->getRecordActions(), function (array $carry, $action) use ($record): array { $action = $action->getClone(); if (! $action instanceof \Filament\Actions\BulkAction) { $action->record($record); } if ($action->isHidden()) { return $carry; } $carry[] = $action; return $carry; }, [], ); @endphp {{-- Tree Item Container --}}