Download the PHP package wsmallnews/filament-nestedset without Composer
On this page you can find all versions of the php package wsmallnews/filament-nestedset. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wsmallnews/filament-nestedset
More information about wsmallnews/filament-nestedset
Files in wsmallnews/filament-nestedset
Package filament-nestedset
Short Description Filament nestedset tree builder powered by kalnoy/nestedset with Filament v4 and v5 support
License MIT
Homepage https://github.com/wsmallnews/filament-nestedset
Informations about the package filament-nestedset
Filament tree build on kalnoy/nestedset
Supports Filament v4 and v5. If you are currently using Filament v3, please refer to this link here
Filament nestedset tree build on kalnoy/nestedset, support multi language. support Multi-tenancy
Overview
- Elegant UI, consistent with the default style of the filament page
- The Filament nestedset plugin is built on kalnoy/nestedset
- ParentSelect field depends on codewithdennis/filament-select-tree
- Some features are borrowed from 15web/filament-tree
- Support multi-tenancy, you can easily create nestedset pages among multiple tenants
- Nestedset level is unlimited by default, but you can limit the nestedset levels if you wish
- Support tabs consistent with the Listing records of the filament panel. You can switch between different nestedset data through tabs on the current page
- Support laravel-boost and add AI Guidelines
Screenshots


AI Guidelines
First, you should install laravel-boost. See details here
You should Update Boost resources to ensure that the AI Guidelines for the current package are added to the project overview
Your boost.json and CLAUDE.md files will be updated automatically. You can check the updated files in the project root directory
Installation
You can install the package via composer:
The current release is compatible with both Filament v4 and v5.
You can publish the config file with:
Optionally, you can publish the views using
Multi language support, you can publish the language files using
This is the contents of the published config file:
Prepare your model
You should add fields to your model. replacing your_model_table with the name of your model table
Add fields in the new model
Add fields to an existing model
And run the migration
Usage
Create the nestedset page
Please define attribute name of the nodes in your tree, eg. title or name.
By default, the plugin will use the recordTitleAttribute attribute to display the node name in the tree. If you want to use another attribute, you can define the getRecordLabel method, Support HtmlString.
Define form schema
If the schema for create and edit are the same, you can define the schema method.
If the schema for create and edit are different, you can define createSchema and editSchema methods separately.
Define the prompt text when the tree is empty
Limit nestedset level
Nestedset level is unlimited by default, you can limit the nestedset levels by:
Other customizable properties
Display additional attributes
You can define additional attributes to display in each row through the infolistSchema method
By default, the infolist will be displayed at the md breakpoint and above. You can change the display breakpoint by setting $infolistHiddenEndpoint.
By default, the infolist will be right-aligned. You can change the alignment by setting $infolistAlignment.
Advanced features
Multi-tenancy support
Multi-tenancy features is supported by default. If your filament panel supports multi-tenancy, you need to add the getScopeAttributes method to your model and add the team_id field.
Multi-tenancy features is implemented based on kalnoy/nestedset scoped feature. You can view detailed documentation here
If your filament panel supports multi-tenancy, but the current page doesn't need to distinguish tenancy, just set $isScopedToTenant = false in the page.
Tabs support
Tabs are implemented based on kalnoy/nestedset scoped feature. You can view detailed documentation here
Set the associated tab field name using tabFieldName. And setting tabs array, you don't need to add the current tab condition on the tab, as the tab condition will be automatically appended to kalnoy/nestedset scoping parameters.
You need to add the getScopeAttributes method to your model and add the field set by tabFieldName (type in this case).
Additional scope parameters
If you need to set additional scope parameters for kalnoy/nestedset scoping
Define the nestedScoped method
You need to add the getScopeAttributes method to your model and add the field set.
Add custom eloquent query conditions
Nestedset Livewire component
Overview
- The property
showLevelcan be set to nestedset show level - The property
emptyLabelcan be set to nestedset empty state - The method
getRecordLabelcustom nestedset node label - The method
getHasActivemark active status - You can customize the view by using the
viewandrecordViewproperties - You can use the
getRecordUrlmethod to customize the href jump link, which defaults to insertinghref="JavaScript:;" - When clicking on the nestedset leaf node, a
sn-filament-nestedset-leaf-clickevent will be triggered - When clicking on nestedset non leaf nodes, a
sn-filament-nestedset-node-clickevent will be triggered - Suggest choosing between
eventandgetRecordUrl
Example
Custom theme
By default, the CSS file will be automatically loaded globally. If you use a filament custom theme, you can disable the automatic loading of the CSS file
Disable the automatic loading of the CSS file
You should add the following code to your custom theme file. If you custom theme file is /resources/css/filament/admin/theme.css
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
- smallnews
- kalnoy/nestedset
- codewithdennis/filament-select-tree
- 15web/filament-tree
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of filament-nestedset with dependencies
codewithdennis/filament-select-tree Version ^4.0
filament/filament Version ^4.0 || ^5.0
kalnoy/nestedset Version ^6.0 || ^7.0
spatie/laravel-package-tools Version ^1.15.0