PHPackages                             zakariatlilani/nova-nested-tree - 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. zakariatlilani/nova-nested-tree

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

zakariatlilani/nova-nested-tree
===============================

Nova vue-tree-select field for management nested category relations.

0.0.3(5mo ago)02.7kMITPHPPHP ^8.0

Since Dec 7Pushed 5mo agoCompare

[ Source](https://github.com/ZakariaTlilani/nova-nested-tree)[ Packagist](https://packagist.org/packages/zakariatlilani/nova-nested-tree)[ RSS](/packages/zakariatlilani-nova-nested-tree/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Nova Nested Tree Attach Many
============================

[](#nova-nested-tree-attach-many)

Support Laravel nova 4. for nova 3 , use [this package](https://github.com/phoenix-lib/nova-nested-tree-attach-many).

### Suppot:

[](#suppot)

Belongs To Many Field for simple manage Nested relation tree. Enables attaching relationships easily.

[![nova-nested-tree-attach-many](https://user-images.githubusercontent.com/74270064/98738291-8a872780-23b8-11eb-8c76-a8605abe69f8.gif)](https://user-images.githubusercontent.com/74270064/98738291-8a872780-23b8-11eb-8c76-a8605abe69f8.gif)

### RoadMap

[](#roadmap)

- Validation
- Show selected categories on Detail
- Ability to pass your own tree
- Ability to `Delayed Loading` data when tree has many records ( example 10k+ ).

### Installation

[](#installation)

```
composer require zakariatlilani/nova-nested-tree
```

### Usage

[](#usage)

This field uses tree provided by kalnoy/nestedset package

This field uses riophae/vue-treeselect under the hood

```
use zakariatlilani\NovaNestedTree\NestedTreeAttachManyField;
```

```
public function fields(Request $request)
{
    return [
        NestedTreeAttachManyField::make('Offer Categories',"categories","App\Nova\Category"),
    ];
}
```

Your model should has NodeTrait form package kalnoy/nestedset see RoadMap

```
class Category extends Model
{
    use NodeTrait;
}
```

### Options

[](#options)

Here are a few customization options

- `->searchable(bool $searchable)`
- `->withIdKey(string $idKey = 'id')` // - id column name in your nested model
- `->withLabelKey(string $labelKey = 'name')` // - label column name in your nested model
- `->withActiveKey(string $activeKey)` // - active\_status column name in your nested model used for disable options
- `->withChildrenKey(string $childrenKey)` // - children key in your nested model
- `->withPlaceholder(string $placeholder)` // - placeholder in tree select
- `->withMaxHeight(int $maxHeight)`
- `->withSortValueBy(string $sortBy)` // - @see
- `->withAlwaysOpen(bool $alwaysOpen)` // - by default select is open, but you can change it behavior
- `->withFlatten(bool $flatten)` // - by default flatten is enabled, but you can change it behavior
- `->useSingleSelect()` // - ability for select only one value
- `->useAsField()` // - ability to write result to field without relations

### Example of use with package whitecube/nova-flexible-content

[](#example-of-use-with-package-whitecubenova-flexible-content)

```
use Whitecube\NovaFlexibleContent\Flexible;
use zakariatlilani\NovaNestedTree\NestedTreeAttachManyField;

/**
 * Get the fields displayed by the resource.
 *
 * @param  \Illuminate\Http\Request  $request
 * @return array
 */
public function fields(Request $request)
{
    return [
        // ...

        Flexible::make('Content')
            ->addLayout('Simple content section', 'tree_section', [
                NestedTreeAttachManyField::make('Tree',"tree","App\Nova\Category")
                    ->useAsField(),
            ])
    ];
}
```

### Authorization

[](#authorization)

This field also respects policies: ie Role / Permission

- RolePolicy: attachAnyPermission($user, $role)
- RolePolicy: attachPermission($user, $role, $permission)
- PermissionPolicy: viewAny($user)

### Validation

[](#validation)

You can set min, max, size, required or custom rule objects

```
->rules('min:5', 'max:10', 'size:10', 'required', new CustomRule)`
```

### Contributing

[](#contributing)

Feel free to suggest changes, ask for new features or fix bugs yourself.

Hope this package will be useful for you.

### credit

[](#credit)

[phoenix-lib](https://github.com/phoenix-lib/nova-nested-tree-attach-many)

---

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance71

Regular maintenance activity

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

163d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d4a410fb650e270485c131ed01ac8a6e84ff9ee030dbcc85e3ef6d148eca38b?d=identicon)[zakaria tlilani](/maintainers/zakaria%20tlilani)

---

Top Contributors

[![ZakariaTlilani](https://avatars.githubusercontent.com/u/116965173?v=4)](https://github.com/ZakariaTlilani "ZakariaTlilani (1 commits)")

---

Tags

laravelnested setsnovabelongs-to-many

### Embed Badge

![Health badge](/badges/zakariatlilani-nova-nested-tree/health.svg)

```
[![Health](https://phpackages.com/badges/zakariatlilani-nova-nested-tree/health.svg)](https://phpackages.com/packages/zakariatlilani-nova-nested-tree)
```

###  Alternatives

[phoenix-lib/nova-nested-tree-attach-many

Nova vue-tree-select field for management nested category relations.

3587.4k](/packages/phoenix-lib-nova-nested-tree-attach-many)[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

3403.5M7](/packages/optimistdigital-nova-multiselect-field)[genealabs/laravel-overridable-model

Provide a uniform method of allowing models to be overridden in Laravel.

92398.0k2](/packages/genealabs-laravel-overridable-model)[inspheric/nova-defaultable

Default values for Nova fields when creating resources and running resource actions.

51174.8k1](/packages/inspheric-nova-defaultable)[murdercode/nova4-tinymce-editor

Boost your Laravel Nova with the TinyMCE editor.

17165.2k](/packages/murdercode-nova4-tinymce-editor)[datomatic/nova-detached-actions

A Laravel Nova tool to allow for placing actions in the Nova toolbar detached from the checkbox selection mechanism.

11229.2k](/packages/datomatic-nova-detached-actions)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
