ciaochung/baum
Baum provides nested set model support for Laravel Eloquent models, letting you store and query hierarchical tree data such as categories or menus with efficient ancestor, descendant, sibling, and depth operations.
left/right bounds so that reading an entire subtree or the full ancestor path is a single indexed query rather than a recursive loop. This directly informs whether you hand-roll tree traversal in application code or adopt a schema-level pattern._lft, _rgt, parent_id, depth) that leak into migrations, seeders, admin tooling, and any export/import format. That is a long-lived decision with migration cost, not a library detail.Consider it only when all of the following hold:
baum/baum line stopped tracking Laravel releases years ago, and a 0-star fork gives you no signal that this was fixed._lft/_rgt. A tiny unaudited library is a bad place to discover those.Look elsewhere when:
kalnoy/nestedset — it is actively maintained, widely depended on, supports modern Laravel, and covers the same pattern with better tooling and a real community to absorb the edge cases.parent_id) plus recursive CTEs (MySQL 8+, PostgreSQL) via something like staudenmeir/laravel-cte, or a closure table. Modern databases make adjacency lists far more viable than they were when Baum was written.parent_id and be done — Nested Set's complexity buys you nothing.For executives — the one-liner: This is a small, MIT-licensed Laravel library that implements a well-understood database pattern for storing trees (categories, org units, menus) so that reading a whole branch is one fast query instead of a recursive crawl. The pattern is sound; the specific package is not.
The recommendation: treat it as a reference implementation, not an adoption candidate. It is an unmaintained-lineage fork with no community, no dependents, and no demonstrated Laravel-version support. Adopting it converts a commodity decision into an owned one — we inherit maintenance, patching, and upgrade risk for a component that has a maintained, battle-tested equivalent.
What we do instead: standardize on kalnoy/nestedset for Nested Set needs. It is the same pattern, actively maintained, and clears dependency review. If it does not fit, the decision is between an adjacency list with recursive CTEs and a closure table — both of which we can support with first-party code and no exotic dependency.
For engineering — the honest framing: the reason to look at this repo is the idea, not the artifact. Nested Set is the right shape when reads dominate and the tree is edited rarely; it is the wrong shape under heavy reordering or concurrent moves. Read the Baum source if you want a compact reference for how _lft/_rgt maintenance works, then write or adopt a maintained implementation. The cost of a Nested Set choice is not the library — it is the extra columns, the migration and backfill work, the admin tooling that must respect the bounds, and the move-operation correctness that will outlive any package. Budget for that explicitly, and do not let a 0-star dependency be the thing that makes it fragile.
How can I help you explore Laravel packages today?