Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Filament Tree View

Filament Tree View Laravel Package

openplain/filament-tree-view

Drag-and-drop tree view for Filament resources to manage hierarchical data. Built on Laravel Adjacency List and Atlassian Pragmatic Drag & Drop. Supports depth limits, auto or batch save, custom fields, actions, dark mode, accessibility, and safe moves.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Filament Tree View
How do I replace a Filament Table with a tree view in my resource?
Replace the `table()` method with `tree()` in your Filament resource class. For example, swap `public static function table(Table $table): Table` for `public static function table(TreeView $table): TreeView`. The package provides the same API as Filament’s Table, so customization (columns, actions, etc.) works identically.
Does this package support large trees (e.g., 5,000+ nodes)?
The package includes `maxDepth()` to limit nesting, but performance may degrade with very large trees due to DOM complexity. For trees exceeding 1,000 nodes, consider implementing pagination or virtual scrolling manually, as these features aren’t natively supported. Test with your expected dataset size before deployment.
Can I customize the tree’s appearance beyond dark mode?
Yes, the tree view inherits Filament’s styling system, so you can override CSS classes or use Filament’s built-in theming. For custom fields, use Filament’s field components (e.g., `TextField`, `IconField`) within the `columns()` method. The package also supports custom actions and icons per node.
How does drag-and-drop conflict resolution work for concurrent edits?
The package doesn’t include built-in optimistic locking, so concurrent edits may cause conflicts. Handle this at the application level by implementing server-side validation, retries, or UI feedback (e.g., notifications). For high-traffic systems, consider disabling auto-save and using manual batch saves instead.
Will this work with my existing database schema if it doesn’t use `parent_id` and `order` columns?
Yes, you can customize column names via `getParentKeyName()` and `getOrderKeyName()` methods in your model. The package relies on Laravel Adjacency List, which supports flexible column configurations. Ensure your database schema aligns with the adjacency list pattern (e.g., `parent_id` for hierarchy and `order` for sorting).
Does the tree view support custom business logic, like permissions or audit logs?
The package integrates with Filament’s action system, so you can attach custom logic via actions (e.g., `EditAction`, `DeleteAction`). However, it lacks pre/post-reorder hooks for deep customization. For advanced use cases, extend the package or use Filament’s resource events to trigger custom logic after tree operations.
How do I enable/disable auto-save for drag-and-drop reordering?
Auto-save is enabled by default but can be disabled via the `saveMode()` method in your tree configuration. Use `saveMode(TreeView::SAVE_MODE_BATCH)` to require manual confirmation before saving changes. This is recommended for high-traffic systems to reduce API load.
Is this package compatible with Filament 5 and Laravel 12?
Yes, the package explicitly supports Filament 4.x and 5.x, as well as Laravel 11 and 12. Check the [Packagist page](https://packagist.org/packages/openplain/filament-tree-view) for the latest version compatibility. The API remains consistent across Filament versions, minimizing migration risks.
Can I use this for a headless Laravel API or SPA integration?
The package is designed for Filament’s traditional server-rendered workflow and assumes a full-page reload on changes. For headless APIs or SPAs, you’ll need to manually handle tree state management and API responses. Consider using the underlying adjacency list logic with a custom frontend solution if headless compatibility is critical.
Are there alternatives to this package for Filament tree views?
Alternatives include `spatie/laravel-filament-trees` (for nested resources) or `filament-spatie/laravel-filament-resource-panels` (for panel-based trees). However, this package stands out by offering a drop-in Table replacement with drag-and-drop, built on proven libraries (Adjacency List + Atlassian’s drag-and-drop). Choose based on your need for Filament-native integration vs. customization flexibility.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata