PHPackages                             betterde/tree - 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. betterde/tree

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

betterde/tree
=============

Tree generator

v1.0.8(6y ago)163377MITPHP

Since Apr 13Pushed 6y agoCompare

[ Source](https://github.com/betterde/tree)[ Packagist](https://packagist.org/packages/betterde/tree) Fund[ RSS](/packages/betterde-tree/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (8)Used By (0)

Use guide
=========

[](#use-guide)

```
use Betterde\Tree\Generator;

$menus = [
    [
        'id' => 1,
        'parent_id' => 0,
        'label' => 'Dashboard',
        'link' => '/dashboard',
        'icon' => null,
        'roles' => 'Admin,'
    ],
    [
        'id' => 2,
        'parent_id' => 1,
        'label' => 'Fiance',
        'link' => '/dashboard/finace',
        'icon' => null,
        'roles' => 'Admin,Fiance'
    ],
    [
        'id' => 3,
        'parent_id' => 1,
        'label' => 'Operation',
        'link' => '/dashboard/operation',
        'icon' => null,
        'roles' => 'Admin,Operation'
    ],
];

$generator = new Generator();
$tree = $generator->make($menus, 'id', 'parent_id', 'sub_menus', 0);

```

Generated result
================

[](#generated-result)

```
[
    [
        'id' => 1,
        'parent_id' => 0,
        'label' => 'Dashboard',
        'link' => '/dashboard',
        'icon' => null,
        'roles' => 'Admin,',
        'sub_menus' => [
            [
                'id' => 2,
                'parent_id' => 1,
                'label' => 'Fiance',
                'link' => '/dashboard/finace',
                'icon' => null,
                'roles' => 'Admin,Fiance'
            ],
            [
                'id' => 3,
                'parent_id' => 1,
                'label' => 'Operation',
                'link' => '/dashboard/operation',
                'icon' => null,
                'roles' => 'Admin,Operation'
            ]
        ]
    ]
];
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 95% 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.

###  Release Activity

Cadence

Every ~132 days

Recently: every ~198 days

Total

7

Last Release

2209d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c85593d180ab34bd56247c69debca02794f8f07b7ee0737fc897164858de6b1?d=identicon)[GeorgeKing](/maintainers/GeorgeKing)

---

Top Contributors

[![jinrenjie](https://avatars.githubusercontent.com/u/5665135?v=4)](https://github.com/jinrenjie "jinrenjie (19 commits)")[![puzzle9](https://avatars.githubusercontent.com/u/13518196?v=4)](https://github.com/puzzle9 "puzzle9 (1 commits)")

---

Tags

treegeneratortreenode

### Embed Badge

![Health badge](/badges/betterde-tree/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[wearepixel/laravel-cart

A cart implementation for Laravel

1355.6k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

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