New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

alareqi/filament-tree

Tree-structured Eloquent records rendered through native Filament tables.
1,039 1
Install
composer require alareqi/filament-tree
Latest Version:1.0.2
PHP:^8.3
Laravel:11 · 12 · 13
License:MIT
Last Updated:Sep 20, 2026
Links: GitHub  ·  Packagist
Maintainer: alareqi

Filament Tree

Filament Tree package overview showing expandable hierarchical tables in light and dark modes

Display adjacency-list Eloquent models as expandable, searchable, filterable, and reorderable trees in Filament 5. The package also includes a searchable tree-select form field.

Features

  • Expand and collapse individual branches or the entire tree
  • Use normal Filament table columns, search, filters, actions, and bulk actions
  • Keep matching records visible together with their ancestors while filtering
  • Drag records before, after, or inside another record
  • Save all reorder changes together in a database transaction
  • Select a parent or category with the TreeSelect form component
  • Support integer and string keys, custom root values, RTL layouts, and dark mode
  • Load package styles automatically—no panel plugin or custom theme setup

Requirements

  • PHP 8.3 or later
  • Laravel with Eloquent
  • Filament 5

Installation

composer require alareqi/filament-tree

Laravel discovers the service provider automatically. The provider registers the package views, translations, and compiled CSS, so no panel registration or asset publishing is required.

Quick start

Assume categories is an adjacency-list table:

Schema::create('categories', function (Blueprint $table): void {
    $table->id();
    $table->string('name');
    $table->foreignId('parent_id')->nullable()->constrained('categories')->nullOnDelete();
    $table->unsignedInteger('sort_order')->default(0);
    $table->timestamps();
});

Add InteractsWithTreeTable to the resource's ListRecords page:

use Alareqi\FilamentTree\Concerns\InteractsWithTreeTable;
use Filament\Resources\Pages\ListRecords;

class ListCategories extends ListRecords
{
    use InteractsWithTreeTable;
}

Then use TreeColumn for the visible tree column and call tree() after defining the columns:

use Alareqi\FilamentTree\Columns\TreeColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;

public static function table(Table $table): Table
{
    return $table
        ->columns([
            TreeColumn::make('name')->searchable(),
            TextColumn::make('updated_at')->dateTime()->sortable(),
        ])
        ->reorderable('sort_order')
        ->tree(
            parentColumn: 'parent_id',
            treeColumn: 'name',
        );
}

The table starts expanded, root records have a null parent, and Filament's Enable reordering action starts tree reordering.

[!IMPORTANT] The column named by treeColumn must be a TreeColumn, and the list page must use InteractsWithTreeTable. Call reorderable() before tree() so the package can read Filament's reorder configuration.

Tree select quick start

use Alareqi\FilamentTree\Forms\Components\TreeSelect;

TreeSelect::make('parent_id')
    ->label('Parent category')
    ->treeOptions(fn () => Category::query()
        ->orderBy('sort_order')
        ->get()
        ->map(fn (Category $category): array => [
            'value' => $category->getKey(),
            'parent' => $category->parent_id,
            'label' => $category->name,
        ]))
    ->placeholder('No parent')
    ->searchable();

The placeholder represents null when it is selectable, making this suitable for choosing an optional parent.

Documentation

License

Filament Tree is open-source software licensed under the MIT license.

Related Packages

webbingbrasil/filament-copyactions

A easy-to-use copy actions for Filament Admin.

949,462 93
webbingbrasil/filament-maps

Map components for Filament.

63,459 78
bostjanob/filament-file-manager

Filament File Manager

5,914 4
dejodev/page-blocks

Simple page blocks blocks package for Filament

2,233 0
heloufir/filament-workflow-manager

Manage your own workflows with filament

1,284 70

Version History

Version Released PHP License
1.0.2 ^8.3 MIT
1.0.1 ^8.3 MIT
1.0.0 ^8.3 MIT