PHPackages                             phoenix-lib/nova-nested-tree-attach-many - 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. phoenix-lib/nova-nested-tree-attach-many

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

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

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

1.8.0(4y ago)3587.4k↓33.6%14[8 issues](https://github.com/phoenix-lib/nova-nested-tree-attach-many/issues)MITPHPPHP &gt;=7.1.0

Since Nov 11Pushed 4y ago2 watchersCompare

[ Source](https://github.com/phoenix-lib/nova-nested-tree-attach-many)[ Packagist](https://packagist.org/packages/phoenix-lib/nova-nested-tree-attach-many)[ RSS](/packages/phoenix-lib-nova-nested-tree-attach-many/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (19)Used By (0)

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

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

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![Latest Version on Github](https://camo.githubusercontent.com/41d0148474d98ad84d59f1f8ab671dd5f5e76eaf82759326c5bee918a2530108/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f70686f656e69782d6c69622f6e6f76612d6e65737465642d747265652d6174746163682d6d616e792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phoenix-lib/nova-nested-tree-attach-many)[![Total Downloads](https://camo.githubusercontent.com/c4035e2d1768cc0afd21ad7bbe2dfcd5c67c20ae819464bc11a5b16e00d2b84a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70686f656e69782d6c69622f6e6f76612d6e65737465642d747265652d6174746163682d6d616e792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phoenix-lib/nova-nested-tree-attach-many)

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 phoenix-lib/nova-nested-tree-attach-many
```

### Usage

[](#usage)

This field uses tree provided by kalnoy/nestedset package

This field uses riophae/vue-treeselect under the hood

```
use PhoenixLib\NestedTreeAttachMany\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 PhoenixLib\NovaNestedTreeAttachMany\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.
-----------------------------------------

[](#hope-this-package-will-be-useful-for-you)

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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

Every ~17 days

Recently: every ~46 days

Total

18

Last Release

1720d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/32000311?v=4)[Roman](/maintainers/phoenix-lib)[@phoenix-lib](https://github.com/phoenix-lib)

---

Top Contributors

[![semsphy](https://avatars.githubusercontent.com/u/423396?v=4)](https://github.com/semsphy "semsphy (3 commits)")[![phoenix-lib](https://avatars.githubusercontent.com/u/32000311?v=4)](https://github.com/phoenix-lib "phoenix-lib (2 commits)")[![haoflynet](https://avatars.githubusercontent.com/u/6014844?v=4)](https://github.com/haoflynet "haoflynet (1 commits)")

---

Tags

laravelnested setsnovabelongs-to-many

### Embed Badge

![Health badge](/badges/phoenix-lib-nova-nested-tree-attach-many/health.svg)

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

###  Alternatives

[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)[wemersonrv/input-mask

A Laravel Nova custom field text with masks on input

1196.4k](/packages/wemersonrv-input-mask)

PHPackages © 2026

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