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.
tree() method plus HasTreeStructure trait, so the decision shifts from "do we staff this?" to "do we accept a small third-party dependency?"Table on a resource: Because it mirrors Filament's Table API (fields, recordActions, actions, modal edit), it is a low-friction swap when a flat table proves poor for hierarchical content. Useful as a scoped experiment: ship a tree page next to the existing list page and let power users pick.autoSave() vs. manual Save/Cancel is a real UX decision (safety vs. fluidity) that PMs can now tune per resource without new scope — e.g., auto-save for small internal taxonomies, manual save for large public-facing menus.maxDepth() enforces information-architecture rules (e.g., max 3 levels of categories); reorderable(false) gives you a viewer-only tree for reporting/audit pages using the same config.TreeRelationPage supports managing a child hierarchy from the parent's record page — relevant if you're deciding between "nested resource" vs. "sub-navigation tab" UX.Adopt when:
parent_id + order). Greenfield schemas are trivial; legacy schemas are only viable if you can override getParentKeyName()/getLocalKeyName() to match existing columns.Look elsewhere or build when:
collapsed() and test with production-sized data before committing.To executives: This is a small, MIT-licensed add-on that lets us ship hierarchical admin features — category trees, menus, org structures — in days instead of weeks. It reuses Filament, which we already run, and proven libraries (Staudenmeir's adjacency list, Atlassian's drag-and-drop from Jira/Trello). Cost: one Composer dependency, no licensing fee, no new infrastructure. Trade-off: it's young OSS with a small community, so we contain the risk by pinning the version and keeping our own usage thin (one resource, clear fallback to a flat table if needed).
To engineering: The integration surface is deliberately Filament-shaped — add HasTreeStructure to the model, a tree() method to the resource, and a TreePage (or TreeRelationPage for relation sub-navigation). Required schema columns are just parent_id and order, with overridable column names for legacy tables. It ships safe operations (circular-reference guards, cascade delete), configurable depth, and auto-save vs. manual save. Two caveats to own explicitly: (1) it is early-stage — 41 stars, no dependents, single-maintainer risk — so we should read the source for the paths we use rather than treat it as opaque; (2) it is opinionated toward adjacency lists, so if our storage model diverges we are writing adapters. Recommendation: pilot on one low-blast-radius resource, measure node counts and save latency with realistic data, then decide on broader rollout.
How can I help you explore Laravel packages today?