cline/ancestry

Closure table hierarchies for Eloquent models with O(1) ancestor/descendant queries.
16,883 1
Install
composer require cline/ancestry
Latest Version:2.0.3
PHP:^8.5.0
License:MIT
Last Updated:Mar 18, 2026
Links: GitHub  ·  Packagist
Maintainer: faustbrian

GitHub Workflow Status Latest Version on Packagist Software License Total Downloads


Ancestry

Closure table hierarchies for Eloquent models with O(1) ancestor/descendant queries.

Ancestry implements the closure table pattern for managing hierarchical relationships in Laravel. This enables efficient queries for ancestors and descendants without recursion limits, supporting deeply nested relationships like organizational charts, sales hierarchies, and category trees.

Documentation

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please use the GitHub security reporting form rather than the issue queue.

Credits

License

The MIT License. Please see License File for more information.

Related Packages

nevadskiy/laravel-tree

Tree-like structure for Eloquent models.

112,554 68
baril/bonsai

An implementation of the Closure Tables pattern for Eloquent.

97,480 35
baum/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

1,657,355 2,224
webfactorybulgaria/nestablecollection

A Laravel Package that extends Collection to handle unlimited nested items follo...

509 0