Skip to content

goez-tools/tree-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adjacency List model for Laravel Eloquent

Build Status

Goez/TreeData is an adjacency list visitor for Eloquent model.

Usage

Goez/TreeData is designed for Laravel 4.2+, just follow the steps below:

  1. Install from composer.

    composer require goez/tree-data
  2. 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

About

Adjacency List model for Laravel 4

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages