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

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

flex/tree
=========

Tree generator

v1.0(3y ago)05.5k↑881.3%1MITPHP

Since Mar 1Pushed 3y agoCompare

[ Source](https://github.com/inbjo/tree)[ Packagist](https://packagist.org/packages/flex/tree)[ RSS](/packages/flex-tree/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (2)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

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

1221d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0071a236e8e4c14787e83570e000c43a84b09b404b9fd7c9e383b08eca426afe?d=identicon)[Xiazi](/maintainers/Xiazi)

---

Top Contributors

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

---

Tags

generatortreenode

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)[wearepixel/laravel-cart

A cart implementation for Laravel

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

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

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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