PHPackages                             encima-io/albero - 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. [Database &amp; ORM](/categories/database)
4. /
5. encima-io/albero

ActiveLibrary[Database &amp; ORM](/categories/database)

encima-io/albero
================

Albero is an implementation of the Nested Set pattern for Laravels eloquent models.

1.0.1(5y ago)22.9k[2 issues](https://github.com/encima-io/albero/issues)MITPHPPHP &gt;=7.4.0

Since May 26Pushed 5y agoCompare

[ Source](https://github.com/encima-io/albero)[ Packagist](https://packagist.org/packages/encima-io/albero)[ RSS](/packages/encima-io-albero/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Albero
======

[](#albero)

[![Build Status](https://camo.githubusercontent.com/906beff789a2ea33f5daee8088b5f790878e97e606a9c8ce9c19c64ec0653097/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f656e63696d612d696f2f616c6265726f2f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/encima-io/albero/build-status/master)[![Latest Version on Packagist](https://camo.githubusercontent.com/629892680def00faec402657830776f3a1595c15c81d7faa0a590e7ab1537e52/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656e63696d612d696f2f616c6265726f2e737667)](https://packagist.org/packages/encima-io/albero)[![License](https://camo.githubusercontent.com/712e520649445939aac48eaa58d07f247639ad64cc5054ae7375ae93535bce12/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f656e63696d612d696f2f616c6265726f2e737667)](https://packagist.org/packages/encima-io/albero)[![Total Downloads](https://camo.githubusercontent.com/5cfabf46fac2148726a7eeeeee1022c94f43e8c5f6b90cf0adab089bbb03564a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656e63696d612d696f2f616c6265726f2e737667)](https://packagist.org/packages/encima-io/albero)

Albero is an implementation of the [Nested Set](http://en.wikipedia.org/wiki/Nested_set_model) pattern for [Laravel 7's](http://laravel.com/) Eloquent ORM.

Albero is basically an updated version of the popular [Baum package](https://github.com/etrepat/baum) which haven't been updated the last five years!

Documentation
-------------

[](#documentation)

- [Changes from Baum](#changes)
- [Example usage](#example)
- [Notes](#note)

Baum Documentation (updated)
----------------------------

[](#baum-documentation-updated)

- [About Nested Sets](#about)
- [The theory behind, a TL;DR version](#theory)
- [Installation](#installation)
- [Getting started](#getting-started)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)
- [Encima](#about)

Changes from Baum
-----------------

[](#changes-from-baum)

- This version uses [orchestra/testbench](https://github.com/orchestral/testbench) for testing.
- The implementation is moved to a trait, instead of a model that you need to extend. Now use the "HasNestedSets" trait.
- This version requires PHP v7.4, as it uses typed properties (7.4) and return type declarations (7.1)
- This version default to use columns **'left'** and **'right'**, instead of 'lft' and 'rgt'.

Example usage
-------------

[](#example-usage)

```
