openplain/filament-tree-view
A drag-and-drop tree view component for Filament resources that makes managing hierarchical data feel native, with depth control, auto or batch save modes, custom fields, actions, dark mode, and accessible keyboard navigation.
Architecture fit
Tree builder object that mirrors the Table builder, TreePage extending the standard resource page, and TreeRelationPage for ManageRelatedRecords sub-pages. It composes Filament's own Field and Action primitives (TextField, IconField, EditAction, DeleteAction) rather than introducing a parallel abstraction layer. For a Filament shop this is the lowest-friction shape a third-party component can take.parent_id + order) via staudenmeir/laravel-adjacency-list, a mature package with broad production usage. This is the right choice over nested sets for a CRUD admin: cheap inserts and moves, at the cost of recursive read queries.tree() sits alongside form() and table() on the resource. Nothing existing is replaced unless we choose to swap the index page.Integration feasibility
parent_id = null, order assigned) and a decision on whether order is unique-per-parent or global.Technical risk
HasTreeStructure trait provides "automatic cascade delete for descendants." This is model-level, so it applies to every deletion path in the application — admin panel, API, queue jobs, tinker — not just the tree page. A mistaken delete silently removes an entire subtree. The README's DeleteAction example surfaces descendant counts in a modal, but that is opt-in developer configuration, not a package guarantee. We must verify whether the cascade is implemented as a DB-level self-referencing FK cascade, an Eloquent event, or both, and whether it can be disabled.order/parent_id corruption.Key questions
Stack fit
Requires PHP 8.2+, Laravel 11/12, Filament 4/5. This is a clean fit for new panels and a hard blocker for any panel still on Filament 3. Because Filament is Livewire-based, the drag-and-drop component runs over the existing Livewire request cycle — no new JS build step, no separate SPA surface, no additional runtime infrastructure. Operationally it is the same deploy artifact.
Migration path
parent_id (nullable, self-referencing FK) and order (integer, default 0) via migration; backfill existing rows as roots with sequential order.ListRecords index page intact and expose the tree at a separate route (/tree) during the pilot. This gives us a side-by-side comparison and a zero-risk rollback.TreePage to index and retire the flat table for that resource.Compatibility
getParentKeyName, getLocalKeyName) cover legacy schemas without renaming columns — useful for inherited databases.order column semantics: if any existing code sorts children by a different field, the tree view and that code will disagree.Sequencing
Schema and trait (0.5 day) → single resource tree page behind a separate route (1–2 days) → validation of save semantics, cascade behavior, and circular-move rejection (1 day) → feature-flagged rollout to remaining hierarchical models (1–2 days each) → optional promotion to index. Budget a half-day spike up front purely to answer the key questions above; the answers materially change the risk posture.
Maintenance
Tree builder, the field classes, and the page wrappers.staudenmeir/laravel-adjacency-list is benign — it is more established than the package itself and is the more likely component to survive.Support
Scaling
depth attribute is computed at query time and not stored. On trees in the low thousands this is fine; on larger trees it needs caching or a materialized path.collapsed() and a bounded maxDepth() on anything beyond a few hundred nodes.Failure modes
DeleteAction modal and by restricting the trait to models where subtree deletion is genuinely intended.parent_id/order state, with no conflict detection.order values after bulk imports that bypass the package.maxDepth() after data exists, leaving deeper nodes unreachable or unrenderable.php artisan filament:assets on deploy — the failure is silent and the symptom is a broken or unstyled drag surface, which is easy to misdiagnose.Ramp-up
Verdict: Reasonable adopt for a Filament 4+ panel needing hierarchical admin data, piloted on one non-critical taxonomy with cascade delete explicitly reviewed. Not appropriate for Filament 3 shops, and not appropriate for a core business hierarchy until the cascade and concurrency questions are answered.
How can I help you explore Laravel packages today?