phpinnacle / dendros
A plugin for Laravel Filament to handle tree structures.
Requires
- php: ^8.4
- codewithdennis/filament-select-tree: ^4.0
- kisame76/filament-tree-table: ^1.3
- spatie/laravel-package-tools: ^1.92
This package is auto-updated.
Last update: 2026-09-01 15:41:27 UTC
README
Dendros supplies Eloquent and Filament building blocks for hierarchical records. It combines database path helpers, ancestor and descendant relations, a tree-aware model concern, tree selection and tree table pages.
Features
AsTreeconcern for hierarchical Eloquent models.- Materialized path value object and database helpers.
Ancestors,Descendantsand deep has-many relations.- Filament
NodeTreeform component. TreeTable,RecordsTreeandRelationsTreeUI foundations.- Integration with Filament Select Tree and Filament Tree Table.
Installation
composer require phpinnacle/dendros
php artisan vendor:publish --tag="phpinnacle-dendros-migrations"
php artisan migrate
The published migration creates the database helpers required by the path implementation. Review it for compatibility with the application's database engine before running it.
Model usage
use Illuminate\Database\Eloquent\Model; use PHPinnacle\Dendros\AsTree; class Category extends Model { use AsTree; }
Use NodeTree when a Filament form must select a node, and extend RecordsTree or RelationsTree for dedicated hierarchy pages. TreeTable provides the corresponding hierarchical table configuration.
The model and migration must follow the column contract expected by AsTree; inspect the concern and sibling models before adapting an existing table.
Testing
composer test
Changelog and license
See CHANGELOG. Released under the MIT License.