PHPackages                             bootpress/hierarchy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bootpress/hierarchy

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bootpress/hierarchy
===================

Nested Set benefits with Adjacency List effort. Retrieve the children, counts, levels, paths, trees, nests, and leaves from your category nodes.

v1.0(9y ago)11.0k12MITPHPPHP &gt;=5.4

Since Sep 28Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Kylob/Hierarchy)[ Packagist](https://packagist.org/packages/bootpress/hierarchy)[ RSS](/packages/bootpress-hierarchy/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (2)

use BootPress\\Hierarchy\\Component as Hierarchy;
=================================================

[](#use-bootpresshierarchycomponent-as-hierarchy)

[![Packagist](https://camo.githubusercontent.com/f5b393cc5990764eb94ac4f2e9d340245995afa9b55b71473ba82bb5b38f6c5a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626f6f7470726573732f6869657261726368792e7376673f7374796c653d666c61742d737175617265266c6162656c3d5061636b6167697374)](https://packagist.org/packages/bootpress/hierarchy)[![License MIT](https://camo.githubusercontent.com/a7e65aee57b11d28e4caff8b945729a66be0bb663f7f93bd24c5aa65699f148e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![HHVM Tested](https://camo.githubusercontent.com/3422fab0fbdb2e50d74ced25d6df3e7e1be8b373f48c708a785f247a503409d1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4848564d2d5465737465642d3838393262662e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Kylob/Hierarchy)[![PHP 7 Supported](https://camo.githubusercontent.com/7dae9186d16bac6b5d5cee34d3bec4400516657b575bc1c784125d70a6871126/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f504850253230372d537570706f727465642d3838393262662e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Kylob/Hierarchy)[![Build Status](https://camo.githubusercontent.com/01f65eae4ae13d22d8097740d6925be61b5fc335a7b4f8410b5e620e9fac2d28/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4b796c6f622f4869657261726368792f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Kylob/Hierarchy)[![Code Climate](https://camo.githubusercontent.com/7f5087df2c67953241a3c24efb50a8f1b210fa1072784a182cc26e7194c67386/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6769746875622f4b796c6f622f4869657261726368792e7376673f7374796c653d666c61742d737175617265)](https://codeclimate.com/github/Kylob/Hierarchy)[![Test Coverage](https://camo.githubusercontent.com/ff121d03f6e7ccb8bdda1d69a25f28b68318ad7b4be5f1148fe88c9a821bb889/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f636f7665726167652f6769746875622f4b796c6f622f4869657261726368792e7376673f7374796c653d666c61742d737175617265)](https://codeclimate.com/github/Kylob/Hierarchy/coverage)

The BootPress Hierarchy Component bridges the gap between Adjacency lists, and the [Nested Set Model](http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/) so that you can have both the simplicity of Adjacency lists, with the power and efficiency of Nested sets.

Installation
------------

[](#installation)

Add the following to your `composer.json` file.

```
{
    "require": {
        "bootpress/hierarchy": "^1.0"
    }
}
```

Example Usage
-------------

[](#example-usage)

```
