PHPackages                             it-delmax/filament-treeview - 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. [Admin Panels](/categories/admin)
4. /
5. it-delmax/filament-treeview

ActiveLibrary[Admin Panels](/categories/admin)

it-delmax/filament-treeview
===========================

Tree view for Filament resources - drop-in replacement for Table with drag-and-drop hierarchical data management

0.5.0(2mo ago)08MITPHPPHP ^8.2|^8.3

Since Dec 17Pushed 2mo agoCompare

[ Source](https://github.com/it-delmax/filament-treeview)[ Packagist](https://packagist.org/packages/it-delmax/filament-treeview)[ RSS](/packages/it-delmax-filament-treeview/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (6)Used By (0)

Filament Tree View
==================

[](#filament-tree-view)

[![Latest Version on Packagist](https://camo.githubusercontent.com/80fc02f9ac6c1652d3ea0d2d3c8c07024406d3dd9d787edd5e1d65432ee6d32b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f70656e706c61696e2f66696c616d656e742d747265652d766965772e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/openplain/filament-tree-view)[![Total Downloads](https://camo.githubusercontent.com/2406c735a506ce2aaa3dc3674fb6c2c80104ce124b2aa50e23e8c5799bcb2186/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f70656e706c61696e2f66696c616d656e742d747265652d766965772e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/openplain/filament-tree-view)

A powerful drag-and-drop tree view for Filament resources. Display and manage hierarchical data with the same elegant developer experience you expect from Filament.

[![Filament Tree View Demo](docs/images/image.png)](docs/images/image.png)

Why This Package?
-----------------

[](#why-this-package)

We created Filament Tree View because we couldn't find a hierarchical data solution that truly embraced Filament's philosophy and architecture. Most tree packages feel like external additions rather than native Filament components.

**Our Goal:** Make hierarchical data management feel as natural as using Filament's Table component.

### Built on Proven Technology

[](#built-on-proven-technology)

Rather than reinventing the wheel, we leverage battle-tested libraries:

- **[Laravel Adjacency List](https://github.com/staudenmeir/laravel-adjacency-list)** - Mature, proven package for recursive relationships with thousands of production deployments
- **[Pragmatic Drag &amp; Drop](https://atlassian.design/components/pragmatic-drag-and-drop)** - Atlassian's accessible, performant drag-and-drop library used in Jira, Trello, and Confluence
- **Filament's Core Components** - Built with the same patterns, conventions, and architecture as native Filament resources

This foundation gives you reliability, performance, and accessibility out of the box.

Features
--------

[](#features)

- 🌳 **Drag-and-Drop Reordering** - Intuitive tree manipulation with visual feedback
- 📦 **Drop-in Replacement** - Familiar API if you've used Filament Tables
- 🎯 **Depth Control** - Limit tree nesting to prevent overly complex hierarchies
- 💾 **Save Modes** - Choose between auto-save or batch save with manual confirmation
- 🎨 **Custom Fields** - Display any data in your tree nodes with TextField and IconField
- 🔧 **Actions Support** - Full support for Filament actions (edit, delete, custom actions)
- 🌗 **Dark Mode** - Seamless integration with Filament's theming system
- ♿ **Accessible** - Keyboard navigation and screen reader support built-in
- 🔒 **Safe Operations** - Prevents circular references and invalid moves

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- Laravel 11 or 12
- Filament 4.0 or higher

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

[](#installation)

Install the package via Composer:

```
composer require openplain/filament-tree-view
```

Publish the package assets:

```
php artisan filament:assets
```

That's it! The plugin registers its CSS and JavaScript assets with Filament automatically. Everything is now configured and ready to use.

Quick Start
-----------

[](#quick-start)

### 1. Prepare Your Database

[](#1-prepare-your-database)

Create a migration with the required tree structure columns:

```
Schema::create('categories', function (Blueprint $table) {
    $table->id();
    $table->string('name');
    $table->boolean('is_active')->default(true);

    // Required for tree structure
    $table->foreignId('parent_id')->nullable()->constrained('categories');
    $table->integer('order')->default(0);

    $table->timestamps();
});
```

### 2. Add Trait to Your Model

[](#2-add-trait-to-your-model)

Add the `HasTreeStructure` trait to enable tree functionality:

```
