yajra/baum
yajra/baum adds nested set trees to Laravel Eloquent, so you can store and query hierarchical data like categories and menus. Create, move, and reorder nodes and fetch ancestors, descendants, and siblings efficiently through an intuitive ActiveRecord-style API.
lft/rgt/depth), adjacency list with recursive CTEs, materialized path, or closure table. yajra/baum is one candidate in that fork, and a legitimate one only when reads dominate writes and the tree is deep enough that recursive traversal shows up as a measurable cost.etrepat/baum (Laravel 4/5 era). The PM question it actually answers is "do we contain the tree logic we already run, or fund a migration to kalnoy/nestedset?" — not "should we adopt a new strategic dependency."ltree is a platform-level bet (raw SQL range updates, driver-specific locking, index strategy), not an implementation detail a developer should settle alone.Consider it when:
etrepat/baum or an older Baum fork in an existing Laravel codebase and need the lowest-friction path to keep it alive. This is the single strongest argument for yajra/baum.extend Baum\Node) rather than a query-builder abstraction, and the team already models hierarchies with lft/rgt/depth and understands the write amplification.Look elsewhere when:
kalnoy/nestedset is the de facto Eloquent nested set implementation with far broader adoption, active maintenance, and comparable semantics.ltree and you want to avoid lft/rgt write amplification entirely — staudenmeir/laravel-adjacency-list is the mainstream option.Honest read: the package's own signal says legacy-compatibility glue, not a strategic bet. If adopted, pair it with a funded migration plan and do not migrate production data before tree-invariant tests exist in CI.
For executives: yajra/baum is a small, MIT-licensed utility for storing and querying hierarchical data — categories, menus, org structures — inside a Laravel application. We are not recommending it as a new dependency or a strategic investment. Its ecosystem traction is negligible (a handful of stars, no known downstream consumers) and it is effectively unmaintained, so it carries abandonment risk with no community support and no security-patch pipeline. Recommended position: do not adopt for new work; where it exists in our codebase, treat it as legacy glue to be contained, tested, and eventually replaced with a mainstream alternative such as kalnoy/nestedset. Cost is bounded — the code is small enough to fork and own like an internal library — but that ownership needs a named budget line, not an assumption. No roadmap or headcount impact beyond that contained maintenance cost.
For engineering: yajra/baum is a nested set implementation for Eloquent — lft/rgt/depth/parent_id columns, O(1) ancestor and descendant reads, O(n) writes on insert and move. Its practical value is as the continuing fork of the abandoned etrepat/baum, giving older codebases a migration path. Treat it as a reference implementation, not a supported dependency: expect Composer constraint failures on modern Laravel/PHP, and if it installs, expect runtime breakage on the move/delete paths that Eloquent API drift hits first. If we keep it, vendor it into a private package with explicit framework constraints, wrap all mutations in transactions, serialize concurrent writes per tree, and add invariant checks (no overlapping ranges, depth consistency, scope isolation, soft-delete handling) to CI before touching data. For anything greenfield, use kalnoy/nestedset; if writes dominate, use staudenmeir/laravel-adjacency-list and recursive CTEs instead.
How can I help you explore Laravel packages today?