lychee-org/nestedset
Lychee's Nested Set package brings the nested set model to Laravel's Eloquent, so you can store and query hierarchical data—trees, categories, menus—with fast ancestor and descendant lookups and an expressive API for creating, moving, and traversing nodes.
Consider it when:
Look elsewhere when:
To executives: We need hierarchical data in several roadmap features. The underlying technique is well-established and this package wraps it for our framework version, so we can ship tree functionality in days instead of building and debugging it ourselves. The caveat is support: this is a small fork, not a widely adopted library, so I am recommending we adopt it with a containment plan — a thin internal layer so it can be swapped, a pinned version, and roughly one to two engineering days to evaluate and wrap. That converts a maintenance risk into a bounded, reversible decision.
To engineering: Proven nested-set semantics with Eloquent integration, kept current for Laravel 12. The algorithm is not novel; the risk is custodianship, not correctness. Proposal: vendor or pin the dependency, wrap all tree operations behind our own interface, add test coverage for move/delete edge cases, and set a quarterly check on upstream activity with a fallback path to forking internally. If the hierarchy is write-heavy, flag it now — that changes the recommendation before we commit the schema.
How can I help you explore Laravel packages today?