novius/laravel-nova-order-nestedset-field
A Laravel Nova field for ordering nested set models. Drag and drop tree nodes, move items between parents, and reorder siblings, backed by nested set logic. Configurable depth, sibling or free ordering, and smooth integration with Nova resource forms and index views.
sort_order / parent_id integers. This is a UX bet on internal tooling — navigation menus, product category trees, help-center/FAQ sections, course modules, workflow steps. It changes how fast and how safely your team restructures content, not what customers see.composer require. But license cost is not the whole equation: the real choice on the table is adopt-and-own vs. fork-and-own vs. rebuild, and only the first is cheap. Budget internal ownership explicitly.spatie/laravel-sortable with an integer column. Reaching for nested set on a flat list buys write amplification and corruption risk for zero product value. Because this package makes that mistake easy to make, a PM should be the one to name the line.canSee), not an engineering one.Adopt when all of these hold:
kalnoy/nestedset's NodeTrait, with _lft, _rgt, parent_id, and usually depth.parent_id editing path, and ship a nighty countErrors() / fixTree() repair command with alerting.Look elsewhere when:
kalnoy/nestedset directly.spatie/laravel-sortable plus an integer column is proportionate.To executives — one paragraph: This is a small, low-cost internal-tooling component that lets content editors restructure navigation menus and category trees by dragging, instead of a developer editing database rows. It replaces an estimated one to three weeks of build with an afternoon of integration, on a low-stakes resource, behind the admin panel. It carries no customer-facing risk on day one and no license fee. The trade-off is ownership: it is a small open-source package with almost no external adoption, so we are committing to pin it, test it against our own models, and re-evaluate at every Nova upgrade. Recommend approving a single-resource pilot, not a platform-wide rollout.
To engineering — the decision and the conditions: Treat this as adopt-and-own, not install-and-forget. Prerequisites are non-negotiable: Nova installed and its major version noted against the package's composer.json constraint before composer require; a model on NodeTrait; a fully backfilled, fixTree()-validated tree before the field ever renders. Subclass the field immediately so resources never reference the vendor class; keep a plain parent_id input alongside it as both UX fallback and diagnostic lever; enforce one team rule that all tree writes go through the nested-set API (appendToNode, saveAsRoot, moveTo…), with seeders and bulk updates wrapped accordingly. Ship countErrors() monitoring plus a repair command in the first sprint, and an invariant test suite (reorder, reparent, subtree delete, root creation) against our models — that suite is what gets us through a Nova upgrade.
The risks to state out loud, once, up front:
Rollout: one genuinely hierarchical, low-stakes resource (nav menu or product categories) on a branch; exercise the four operations that matter; watch it for a sprint; only then generalize. Fork or vendor before the second resource — the codebase is small enough that waiting until it breaks costs more than forking now.
How can I help you explore Laravel packages today?