phoenix-lib/nova-nested-tree-attach-many
Phoenix Lib's Nova Nested Tree Attach Many adds a Laravel Nova field for selecting and attaching many related records through a nested tree UI. Browse hierarchical data, search nodes, and manage parent-child selections directly from Nova forms.
BelongsToMany pivot, it does not constrain or prejudge your data model. Ship it, measure whether editors actually use tree navigation versus search, and revert with a one-line field removal if they don't. This is a low-regret experiment — appropriate to slot as an incremental admin improvement, not a quarterly initiative or a line item that blocks other roadmap work.authorizedToAttachAny policies, a tenant global scope on the tree query, and Nova activity logging. A field that surfaces nodes a user isn't permitted to attach is a real security bug, so test it explicitly rather than assuming the package handles it.Adopt when all of these hold:
composer.json passes a ten-minute constraint check. A failed constraint solve or a Vue 2 asset in a Vue 3 Nova is an immediate reject — don't spend a spike on it.BelongsToMany (e.g. category_category pivot with multiple parents per node). If your model is a single parent_id, the attach-many semantics are the wrong shape and this is the wrong tool.BelongsToMany field. If search wins on usability, take the option with no external dependency — the tree is a nicety, the dependency is forever.Look elsewhere when:
position, ordering, per-attachment metadata). This is a selector, not a pivot editor — do ordering and metadata through a Nova Action, observer, or purpose-built screen instead of fighting the component.To executives (one paragraph): We can eliminate a recurring manual workflow in admin — assigning records into nested category trees — with roughly half a day of integration using a small, MIT-licensed open-source field we will fork and own. It sits on top of our existing standard database relationships, so it commits us to nothing architecturally and can be removed with a one-line change if editors don't adopt it. The costs are small and bounded: we maintain a pinned fork, carry one regression test, and re-verify on each Nova upgrade. The main constraint is that our Nova version determines whether it works out of the box or needs a short patch, and at very large category volumes we'd revert to a searchable picker. Recommendation: approve as a low-regret admin improvement with a defined exit path, not as a platform bet.
To engineering (summary): Thin Nova field wrapping standard BelongsToMany attach/detach through a nested tree UI. Pin ^1.8, fork on day one, pull via VCS repository, do not float on dev-master. Acceptance test is the loop, not a feature list: seed 10 → 500 → a few thousand nodes; open form, expand tree, attach two, save, reopen, detach one, save, and re-save unchanged to prove save semantics. Index parent_id and both pivot columns first — a missing index will look like a package bug. Keep authorization, tenancy scoping, and audit in policies/global scopes/activity logs, not in the field. Note that 1.8.0 adds a query-cache flush on save for models using laravel-eloquent-query-cache, so the upgrade is not behaviorally inert — review that diff. Customization surface is three places: chainable methods on the field (read src/NestedTreeAttachMany.php for the authoritative list), global scopes on the related resource, and model observers on both sides of the pivot. Beyond that, patch the fork — it's cheaper than lobbying upstream.
Decision ask: Approve a timeboxed spike (one engineer, ~1 day) to confirm the Nova version matrix and run the attach/detach acceptance loop against a realistic seed. Go/no-go criteria: field renders and persists correctly, unchanged re-save does not wipe pivot rows, and the tree stays responsive at our current category volume. If any of those fail, fall back to core Nova BelongsToMany with search and close the item.
How can I help you explore Laravel packages today?