Alareqi Tree
CommunityDisplay and manage hierarchical Eloquent records in Filament using expandable tree tables, drag-and-drop reordering, search, filters, and a tree-select form field.
Author:
Ayman Alareqi
Package health
BetaAutomated checks of this plugin's Composer package
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.lockis 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.3supports current PHP8.5. - Skipped: Current Symfony version supported
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
.
Documentation
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
TreeSelectform 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
treeColumnmust be aTreeColumn, and the list page must useInteractsWithTreeTable. Callreorderable()beforetree()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
- Installation and data model
- Tree tables
- Reordering
- Tree select field
- Customization and API reference
- Troubleshooting and behavior notes
#License
Filament Tree is open-source software licensed under the MIT license.
The author
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.
Featured Plugins
A selection of plugins curated by the Filament team
Blueprint
Filament Blueprint is a premium Laravel Boost extension that helps AI agents produce accurate, detailed implementation plans and security reports for Filament apps.
Filament
Custom Fields
Eliminate custom field migrations forever. Let your users create and manage form fields directly in Filament admin panels with 20+ built-in field types, validation, and zero database changes.
Relaticle
Soft Theme
A theme that gives panels a warm, approachable look with rounded shapes, gentle colors, and serif headings.
Filament