← Back to FAQ

Best Laravel package for the genealogy tree?

kalnoy/nestedset for production. Closure-table alternative is etrepat/baum.

kalnoy/nestedset. Trait-based Eloquent integration, sub-50ms tree queries to about 1,000 nodes, actively maintained for Laravel 11. The closure-table alternative (etrepat/baum) is also fine but slightly more complex to maintain. Both packages handle the genealogy structure cleanly; the choice is mostly preference. Avoid implementing the tree from scratch using parent_id and recursive queries; the performance characteristics break down past a few hundred distributors.