PHPackages                             chel7ch/nestedsets - 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. chel7ch/nestedsets

ActiveLibrary

chel7ch/nestedsets
==================

Nested Set Model

05PHP

Since May 19Pushed 3y agoCompare

[ Source](https://github.com/Chel7ch/nestedSet)[ Packagist](https://packagist.org/packages/chel7ch/nestedsets)[ RSS](/packages/chel7ch-nestedsets/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel package for working with trees in databases.

Theory:

### Using

[](#using)

Each node has 3 unique indexes: id , lk and rk. To start manipulating the nodes of the tree, we learn the attributes of the node:

```
$prop=array('id'=>5, 'lk'=>3, 'rk'=>8);
```

or any part of:

```
$prop=array('lk'=>3);

$node=(new Node)->prepare($prop);
```

### Select

[](#select)

#### the entire branch in which our node participates:

[](#the-entire-branch-in-which-our-node-participates)

```
$tree = new Categories();
$tree->getEntireBranch($node);
```

#### ancestors of node:

[](#ancestors-of-node)

```
$tree->getAncestors($node);
```

#### ancestors of the node and node together:

[](#ancestors-of-the-node-and-node-together)

```
$tree->getAncestorNode($node);
```

#### Node's descendants:

[](#nodes-descendants)

```
$tree->getDescendant($node);
```

#### the descendants with a node:

[](#the-descendants-with-a-node)

```
$tree->getDescendantNode($node);
```

#### all tree:

[](#all-tree)

```
$tree->getTree();
```

### Add node

[](#add-node)

#### only child node:

[](#only-child-node)

```
$tree->createNode($parantNode, $nodeName);
```

#### rename a node:

[](#rename-a-node)

```
$tree->renameNode($node, $newName)
```

#### delete a node with descendants:

[](#delete-a-node-with-descendants)

```
$tree->deleteNode($node);
```

#### clear everything:

[](#clear-everything)

```
$tree->cleanTree();
```

move a node:
------------

[](#move-a-node)

```
$tree->moveNode($node, $newParent);
```

#### check the integrity of the tree:

[](#check-the-integrity-of-the-tree)

```
$check= new CheckOfTree(new Categories);
$check->inspect();
```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a570fefa47030945b8c743814bfe3abceec368882342ace82d8143158b0770c?d=identicon)[Chel7ch](/maintainers/Chel7ch)

---

Top Contributors

[![Chel7ch](https://avatars.githubusercontent.com/u/30697252?v=4)](https://github.com/Chel7ch "Chel7ch (17 commits)")

### Embed Badge

![Health badge](/badges/chel7ch-nestedsets/health.svg)

```
[![Health](https://phpackages.com/badges/chel7ch-nestedsets/health.svg)](https://phpackages.com/packages/chel7ch-nestedsets)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
