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

ActiveLibrary

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

Tree generator

v1.0(3y ago)05.0k↑400%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 1mo ago

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 49% 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

1174d 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

[kitloong/laravel-migrations-generator

Generates Laravel Migrations from an existing database

2.9k7.4M24](/packages/kitloong-laravel-migrations-generator)[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.2k438.5k29](/packages/tightenco-jigsaw)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[typicms/nestablecollection

A Laravel Package that extends Collection to handle unlimited nested items following adjacency list model.

88327.2k20](/packages/typicms-nestablecollection)[baril/bonsai

An implementation of the Closure Tables pattern for Eloquent.

3593.5k](/packages/baril-bonsai)[ultrono/laravel-sitemap

Sitemap generator for Laravel 11, 12 and 13

36412.6k6](/packages/ultrono-laravel-sitemap)

PHPackages © 2026

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