PHPackages                             15web/filament-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. [Database &amp; ORM](/categories/database)
4. /
5. 15web/filament-tree

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

15web/filament-tree
===================

Tree builder for Eloquent models

1.0.3(12mo ago)2213.0k↓10.3%7[1 issues](https://github.com/15web/filament-tree/issues)[1 PRs](https://github.com/15web/filament-tree/pulls)MITPHPPHP ^8.2CI passing

Since Apr 25Pushed 12mo ago5 watchersCompare

[ Source](https://github.com/15web/filament-tree)[ Packagist](https://packagist.org/packages/15web/filament-tree)[ Docs](https://github.com/15web/filament-tree)[ RSS](/packages/15web-filament-tree/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (10)Versions (5)Used By (0)

Eloquent tree with Filament
===========================

[](#eloquent-tree-with-filament)

[![Latest Version on Packagist](https://camo.githubusercontent.com/33f8f8f78e9833f6f05e43ded1eac7afcab9a21921ca7c80008a8021e5a1dcdb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f31357765622f66696c616d656e742d747265652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/15web/filament-tree)[![Build and check code status](https://github.com/15web/filament-tree/actions/workflows/check.yml/badge.svg)](https://github.com/15web/filament-tree/actions)[![PHP Version](https://camo.githubusercontent.com/ce9f0244725ccf0d07ff15f075982163619c525ae3a126a455c052321643a0f6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322d626c75653f7374796c653d666c61742d737175617265266c6f676f3d706870)](https://camo.githubusercontent.com/ce9f0244725ccf0d07ff15f075982163619c525ae3a126a455c052321643a0f6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322d626c75653f7374796c653d666c61742d737175617265266c6f676f3d706870)[![Laravel Version](https://camo.githubusercontent.com/a8f36014948fbf4a9e26a90578ede3204ff540f82173785e3d8ffc717a6f6e87/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31312e302d7265643f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)](https://camo.githubusercontent.com/a8f36014948fbf4a9e26a90578ede3204ff540f82173785e3d8ffc717a6f6e87/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31312e302d7265643f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)[![Filament Version](https://camo.githubusercontent.com/f2e4f903e025d5f1b09983d1afceced7331dbc6ce8d507a075bbeeb6468a034a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f46696c616d656e742d332e322d6f72616e67653f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/f2e4f903e025d5f1b09983d1afceced7331dbc6ce8d507a075bbeeb6468a034a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f46696c616d656e742d332e322d6f72616e67653f7374796c653d666c61742d737175617265)

#### Build the tree from your Eloquent model with Filament

[](#build-the-tree-from-your-eloquent-model-with-filament)

This plugin offers a tree builder for the Filament admin panel, allows you to build menu, category tree and etc. and management.

Advantages of the plugin:

- Isolation of elements (the tree is not rebuilt when editing, when changing a parent - only the changed nodes are re-rendered).
- “Rememberability” of the collapse state. By default, all nodes are collapsed, as a result, the “children” are not rendered so the page loads quickly.
- Display of any attributes (available here ) of model in the tree, which can be useful for content visualization
- The component is all-sufficient as a resource, there is no need for separate pages for creating, editing, listing models.
- For integration, it is enough to add just a trait (or two, if there was no integration with Nested Set) to the model and specify the name of the attribute that will be used as the node header in the tree.

[![Dark Theme](https://raw.githubusercontent.com/15web/filament-tree/refs/heads/main/assets/dark.jpg?raw=true)](https://raw.githubusercontent.com/15web/filament-tree/refs/heads/main/assets/dark.jpg?raw=true)
[![Light Theme](https://raw.githubusercontent.com/15web/filament-tree/refs/heads/main/assets/light.jpg?raw=true)](https://raw.githubusercontent.com/15web/filament-tree/refs/heads/main/assets/light.jpg?raw=true)

Table of Contents:

- [Installation](#installation)
- [Prepare your model](#prepare-your-model)
- [Create the tree page](#create-the-tree-page)
- [Configuration](#configuration)
- [Customization](#customization)
- [Advanced features](#advanced-features)

Installation
------------

[](#installation)

[![Installation](https://raw.githubusercontent.com/15web/filament-tree/refs/heads/main/assets/install.jpg?raw=true)](https://raw.githubusercontent.com/15web/filament-tree/refs/heads/main/assets/install.jpg?raw=true)

You can install the package via composer:

```
composer require 15web/filament-tree
```

Add the plugin service provider to `bootstrap/providers.php`:

```
