Alareqi Tree plugin screenshot
Dark mode ready
Multilingual support
Supports v5.x

Alareqi Tree

Community

Display and manage hierarchical Eloquent records in Filament using expandable tree tables, drag-and-drop reordering, search, filters, and a tree-select form field.

Tags: Form Field Tables Table Column
Supported versions:
5.x
Ayman Alareqi avatar Author: Ayman Alareqi

Package health

Beta

Automated checks of this plugin's Composer package

92 / 100
Security 85
Maintenance 100
Ecosystem 100
15 checks
  • Skipped: GitHub Actions pinned to SHA
  • Skipped: GitLab CI includes pinned to SHA
  • Passed: Open security advisories
  • Passed: Dependabot PR responsiveness — No open Dependabot PRs.
  • Skipped: Renovate MR responsiveness
  • Skipped: Dependabot or Renovate configured
  • Skipped: Dependency update cooldown configured
  • Failed: Provides a security policy View details on Plumb
  • Passed: Abandoned or archived — No consulted source marks the package abandoned (packagist, github).
  • Passed: Commit and release recency — Active: last commit 0 days ago; last release 3 days ago.
  • Passed: composer.lock not committed by library composer.lock is absent from the released dist archive.
  • Passed: Dist archive is lean
  • Passed: Current Laravel version supported — Package dependencies resolve together with current Laravel 13.0.
  • Passed: Current PHP version supported — Constraint ^8.3 supports current PHP 8.5.
  • Skipped: Current Symfony version supported
Third-party plugin. This is built by the community, not the Filament team. Filament does not review, endorse, or vet the security of plugins outside the filament/ namespace. Review the source and install at your own risk. Found malware or an unresolved security issue the author won't address? Report it .
Powered by Plumb Last scanned 13 hours ago

Documentation

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.

The author

Ayman Alareqi avatar Author: Ayman Alareqi

Full-stack developer specializing in Laravel, Filament, and Flutter. I build modern web and mobile applications, SaaS platforms, and developer tools, with a strong focus on clean architecture, reusable components, and great developer experience. I enjoy contributing to the Filament ecosystem by creating plugins and tools that solve real-world development needs.

Plugins
1
Stars
3