Download the PHP package saade/filament-adjacency-list without Composer
On this page you can find all versions of the php package saade/filament-adjacency-list. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download saade/filament-adjacency-list
More information about saade/filament-adjacency-list
Files in saade/filament-adjacency-list
Package filament-adjacency-list
Short Description A Filament package to adjacency lists.
License MIT
Homepage https://github.com/saade/filament-adjacency-list
Informations about the package filament-adjacency-list
Filament Adjacency List
A Filament package to manage adjacency lists (aka trees).
Installation
You can install the package via composer:
Usage
Configuration
Customizing the label
key used to display the item's label
Customizing the children
key used to gather the item's children.
Note: This is only used when not using relationships.
Customizing the MaxDepth
of the tree.
Creating items without a modal.
Disabling creation, edition, deletion, and reordering.
Customizing actions
[!IMPORTANT] Reorder Action
If you want to add
->extraAttributes()
to the action, you need to add the'data-sortable-handle' => 'true'
to the array, as the action serves as a handle for SortableJS.By default, clicking on the action will do anything. If you want to trigger some action on click, you need to chain
->livewireClickHandlerEnabled()
on the action.
Relationships
In this example, we'll be creating a Ticketing system, where tickets can be assigned to a department, and departments have subjects.
Building the relationship
Now you've created a nested relationship between departments and subjects.
Using the relationship
That's it! Now you're able to manage your adjacency lists using relationships.
Working with Staudenmeir's Laravel Adjacency List
This package also supports Staudenmeir's Laravel Adjacency List package.
First, install the package:
- Use the
HasRecursiveRelationships
trait in your model, and override the default path separator.
If you're already using the HasRecursiveRelationships trait for other parts of your application, it's probably not a good idea to change your model's path separator, since it can break other parts of your application. Instead, you can add as many path separators as you want:
- Use the
relationship
method to define the relationship:
That's it! Now you're able to manage your adjacency lists using relationships.
Customizing the query
Ordering
If your application needs to order the items in the list, you can use the orderColumn
method:
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Saade
- Ryan Chandler's Navigation Plugin for his work on the tree UI and complex tree actions.
- Hugh for his help on supporting trees/ graphs relationships.
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of filament-adjacency-list with dependencies
filament/filament Version ^3.0
illuminate/contracts Version ^10.0|^11.0
spatie/laravel-package-tools Version ^1.15.0
staudenmeir/laravel-adjacency-list Version ^1.18