PHPackages                             wsmallnews/filament-nestedset - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. wsmallnews/filament-nestedset

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

wsmallnews/filament-nestedset
=============================

Filament nestedset tree builder powered by kalnoy/nestedset with Filament v4 and v5 support

v2.1.0(3mo ago)163.0k↑113.6%4[2 PRs](https://github.com/Wsmallnews/filament-nestedset/pulls)4MITPHPPHP ^8.2CI passing

Since Aug 18Pushed 3mo agoCompare

[ Source](https://github.com/Wsmallnews/filament-nestedset)[ Packagist](https://packagist.org/packages/wsmallnews/filament-nestedset)[ Docs](https://github.com/wsmallnews/filament-nestedset)[ GitHub Sponsors](https://github.com/Wsmallnews)[ RSS](/packages/wsmallnews-filament-nestedset/feed)WikiDiscussions v2 Synced 1mo ago

READMEChangelog (10)Dependencies (15)Versions (20)Used By (4)

Filament tree build on kalnoy/nestedset
=======================================

[](#filament-tree-build-on-kalnoynestedset)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7612cec4e2667ac6b3f69171e67d42a4cad688dc759301acbb0cad89d01b6501/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77736d616c6c6e6577732f66696c616d656e742d6e65737465647365742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wsmallnews/filament-nestedset)[![GitHub Tests Action Status](https://camo.githubusercontent.com/ae2eca62f07517daaea8a1b5cb7f2e8b7904da609a02617302bdae88a26d8d57/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f77736d616c6c6e6577732f66696c616d656e742d6e65737465647365742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/wsmallnews/filament-nestedset/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/4d3e62c11b29f3d901aa481df3d4eb08a15bd546337e688307fbd7a2fa8e7f36/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f77736d616c6c6e6577732f66696c616d656e742d6e65737465647365742f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/wsmallnews/filament-nestedset/actions?query=workflow%3A%22Fix+PHP+code+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/d74e18d5dbb99c92ce0bca6722889eb61890142a3176d1bd0290fc5c1c49ee13/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77736d616c6c6e6577732f66696c616d656e742d6e65737465647365742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wsmallnews/filament-nestedset)

**Supports Filament v4 and v5. If you are currently using Filament v3, please refer to this link [here](https://github.com/Wsmallnews/filament-nestedset/tree/v1)**

Filament nestedset tree build on kalnoy/nestedset, support multi language. support Multi-tenancy

Overview
--------

[](#overview)

- Elegant UI, consistent with the default style of the filament page
- The Filament nestedset plugin is built on [kalnoy/nestedset](https://github.com/lazychaser/laravel-nestedset)
- ParentSelect field depends on [codewithdennis/filament-select-tree](https://github.com/codewithdennis/filament-select-tree)
- Some features are borrowed from [15web/filament-tree](https://github.com/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

Screenshots
-----------

[](#screenshots)

[![Light](https://raw.githubusercontent.com/Wsmallnews/filament-nestedset/refs/heads/v2/assets/light.png)](https://raw.githubusercontent.com/Wsmallnews/filament-nestedset/refs/heads/v2/assets/light.png)[![Dark](https://raw.githubusercontent.com/Wsmallnews/filament-nestedset/refs/heads/v2/assets/dark.png)](https://raw.githubusercontent.com/Wsmallnews/filament-nestedset/refs/heads/v2/assets/dark.png)
[![Create](https://raw.githubusercontent.com/Wsmallnews/filament-nestedset/refs/heads/v2/assets/create.png)](https://raw.githubusercontent.com/Wsmallnews/filament-nestedset/refs/heads/v2/assets/create.png)[![Hasparentselect](https://raw.githubusercontent.com/Wsmallnews/filament-nestedset/refs/heads/v2/assets/hasparentselect.png)](https://raw.githubusercontent.com/Wsmallnews/filament-nestedset/refs/heads/v2/assets/hasparentselect.png)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require wsmallnews/filament-nestedset:^2.0
```

The current release is compatible with both Filament v4 and v5.

You can publish the config file with:

```
php artisan vendor:publish --tag="sn-filament-nestedset-config"
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="sn-filament-nestedset-views"
```

Multi language support, you can publish the language files using

```
php artisan vendor:publish --tag="sn-filament-nestedset-translations"
```

This is the contents of the published config file:

```
return [
    /**
     * Restrict deletion of nodes with children
     */
    'allow_delete_parent' => false,

    /*
     * Restrict deletion of root nodes, even if 'allow_delete_parent' is true, root nodes can be deleted.
     */
    'allow_delete_root' => false,

    /**
     * create action show parent select field
     */
    'create_action_modal_show_parent_select' => true,

    /**
     * Display the "Create Child Node" action in each row (if 'create_action_modal_show_parent_select' is false, This field should be set to true)
     */
    'show_create_child_node_action_in_row' => true,

    /**
     * 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
     */
    'autoload_assets' => true,
];
```

Prepare your model
------------------

[](#prepare-your-model)

```
