goez / tree-data
6.0.0
2023-09-21 04:31 UTC
Requires
- php: >=7.4
Requires (Dev)
- illuminate/database: >=5.4 <=10
- illuminate/support: >=5.4 <=10
- phpunit/phpunit: 8.*|9.*
README
Goez/TreeData is an adjacency list visitor for Eloquent model.
Usage
Goez/TreeData is designed for Laravel 4.2+, just follow the steps below:
-
Install from composer.
composer require goez/tree-data
-
Add
tree
method in your eloquant model:use Goez\TreeData\Tree; use Illuminate\Database\Eloquent\Model as Eloquent; class Menu extends Eloquent { /** * @return \Goez\TreeData\Visitor\Eloquent */ public function tree() { return Tree::accept($this); } }
Examples
Find examples in tests
folder.
License
MIT