cline / ancestry
Closure table hierarchies for Eloquent models with O(1) ancestor/descendant queries.
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/cline/ancestry
Requires
- php: ^8.5.0
- cline/morpheus: ^1.0.1
- illuminate/container: ^12.0
- illuminate/contracts: ^12.0
- illuminate/database: ^12.0
- illuminate/support: ^12.0
- spatie/laravel-package-tools: ^1.92.7
Requires (Dev)
- cline/php-cs-fixer: ^1.2.1
- driftingly/rector-laravel: ^2.1.3
- ergebnis/composer-normalize: ^2.48.2
- larastan/larastan: ^3.8
- orchestra/testbench: ^10.8
- pestphp/pest: ^4.1.5
- pestphp/pest-plugin-drift: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- pestphp/pest-plugin-type-coverage: ^4.0.3
- phpstan/phpstan: ^2.1.32
- rector/rector: ^2.2.8
- symfony/var-dumper: ^7.3.5
README
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
- Getting Started - Installation, requirements, and quick start
- Basic Usage - Core operations and trait methods
- Fluent API - Chainable, expressive interface
- Configuration - Customize keys, morphs, depth limits
- Multiple Hierarchy Types - One model, many hierarchies
- Custom Key Mapping - Advanced key configuration
- Events - React to hierarchy changes
- Snapshots - Capture point-in-time hierarchy state
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.