Download the PHP package it-delmax/filament-treeview without Composer

On this page you can find all versions of the php package it-delmax/filament-treeview. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-treeview

Filament Tree View

Latest Version on Packagist Total Downloads

A powerful drag-and-drop tree view for Filament resources. Display and manage hierarchical data with the same elegant developer experience you expect from Filament.

Why This Package?

We created Filament Tree View because we couldn't find a hierarchical data solution that truly embraced Filament's philosophy and architecture. Most tree packages feel like external additions rather than native Filament components.

Our Goal: Make hierarchical data management feel as natural as using Filament's Table component.

Built on Proven Technology

Rather than reinventing the wheel, we leverage battle-tested libraries:

This foundation gives you reliability, performance, and accessibility out of the box.

Features

Requirements

Installation

Install the package via Composer:

Publish the package assets:

That's it! The plugin registers its CSS and JavaScript assets with Filament automatically. Everything is now configured and ready to use.

Quick Start

1. Prepare Your Database

Create a migration with the required tree structure columns:

2. Add Trait to Your Model

Add the HasTreeStructure trait to enable tree functionality:

The trait provides:

3. Add Tree Configuration to Your Resource

Add a tree() method to your resource alongside form() and table():

4. Create a Tree Page

Create a simple page that extends TreePage:

That's it! You now have a fully functional drag-and-drop tree view with manual save mode.


Advanced Configuration

Need more control? The tree view offers powerful customization options. All configuration is optional - only add what you need.

Understanding Defaults

The tree uses sensible defaults for most settings:

Quick Links:

Tree Behavior

Control how your tree displays and behaves:

Available Options:

Method Default Description
maxDepth(int\|null) 10 levels Restrict maximum tree depth (pass null for unlimited)
collapsible(bool) Enabled Individual toggles + header Expand All/Collapse All buttons
collapsed() Expanded Start with nodes collapsed instead of expanded
autoSave() Disabled Save changes immediately on drag-and-drop

Common Patterns:

Custom Fields

Fields are required - you must configure which fields to display in your tree nodes.

Use the Field API to define what data appears in each tree node:

TextField Options

IconField Options

Actions

Add actions to tree nodes just like Filament Tables:

Model Configuration

The HasTreeStructure trait uses sensible defaults, but you can customize column names for legacy databases:

Working with Existing Databases

Custom Parent Field Name

If your legacy database uses a different column name for the parent relationship (instead of parent_id), override the getParentKeyName() method:

Common legacy field names:

No migration needed! The tree view will automatically use your custom field name for all queries and updates.

Custom Root Parent Value

If your existing database uses -1, 0, or another value to represent root nodes instead of NULL, override the getParentKeyDefaultValue() method:

Combining Both Customizations

You can override both methods for complete legacy database support:

No database migrations needed! The package handles all queries and updates automatically.

Customizing Empty State

Save Behavior

By default, the tree uses manual save mode - changes require clicking "Save Changes":

Enable auto-save to save immediately on every drag-and-drop:

Why manual save is the default:

When to use auto-save:

Query Customization

Modify the base query for your tree:


Common Patterns

Real-world examples to help you get started quickly:

Building a Navigation Menu

Product Categories with Status

Department Hierarchy

Troubleshooting

Styling Issues or Missing Styles

If the tree view appears unstyled or layouts look broken:

  1. Republish assets:

  2. Clear browser cache - Hard refresh your browser (Cmd+Shift+R on Mac, Ctrl+Shift+R on Windows/Linux)

  3. Clear application caches:

JavaScript Not Loading

If drag-and-drop doesn't work after installation:

Drag Restrictions

If you can't drag items to certain positions:

  1. Depth limit reached - Check your maxDepth() setting
  2. Circular reference - Can't move a parent into its own descendant
  3. Custom canDrop logic - Review any custom drop validation

Performance with Large Trees

For trees with hundreds of nodes:

ComponentNotFoundException After Creating TreePage

If you encounter Unable to find component: [app.filament.resources.blog.categories.pages.tree-categories] when clicking actions:

Cause: Laravel and Livewire cache component registries. New TreePage classes aren't immediately discoverable.

Fix:

This clears Composer's autoloader, Livewire's component cache, and all Laravel caches. The error occurs after creating new TreePage classes or when updating the plugin in development environments.

Testing

Run the test suite:

Run Pint for code style:

Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

Security

If you discover a security vulnerability, please email [email protected]. All security vulnerabilities will be promptly addressed.

Credits

Built with these excellent open-source libraries:

License

The MIT License (MIT). Please see License File for more information.


Built with ❤️ by Openplain


All versions of filament-treeview with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2|^8.3
filament/filament Version ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package it-delmax/filament-treeview contains the following files

Loading the files please wait ...