PHPackages                             bencolmer/nova-resource-hierarchy - 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. bencolmer/nova-resource-hierarchy

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

bencolmer/nova-resource-hierarchy
=================================

A Laravel Nova package that allows you to display and manage resource hierarchy in a tree view.

1.0.0(10mo ago)2165↓50%MITPHPPHP &gt;=8.1

Since Jul 12Pushed 10mo agoCompare

[ Source](https://github.com/bencolmer/nova-resource-hierarchy)[ Packagist](https://packagist.org/packages/bencolmer/nova-resource-hierarchy)[ RSS](/packages/bencolmer-nova-resource-hierarchy/feed)WikiDiscussions master Synced 1mo ago

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

Nova Resource Hierarchy
=======================

[](#nova-resource-hierarchy)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7e6fd71a15b12c75fc8fae54a7e55fb0cc2932f34aa907a210644aef3d036303/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62656e636f6c6d65722f6e6f76612d7265736f757263652d6869657261726368792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bencolmer/nova-resource-hierarchy)

This package allows you to display and manage resource hierarchy in a tree view within [Laravel Nova](https://nova.laravel.com).

[![Resource Hierarchy](docs/index.jpg)](docs/index.jpg)

Features
--------

[](#features)

- Drag-and-drop nesting and reordering
- A large number of [configuration options](#configuration)
- [Laravel Authorization](https://laravel.com/docs/master/authorization) support
- Localization support

Requirements
------------

[](#requirements)

### Installation Requirements

[](#installation-requirements)

- `php: >=8.1`
- `laravel/nova: ^5.0`

### Model Requirements

[](#model-requirements)

This package requires your model's database table to have the following columns:

Column NameDescriptionidThe model's primary key columnparent\_idA self-referencing foreign key columnrankA column recording the order of the hierarchy *(optional - only required if [enabling reordering](#enable-reordering))*You can customize the names of these columns - see [customizing model keys](#customizing-model-keys) below for details.

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

[](#installation)

1. Install this package via composer:

```
composer require bencolmer/nova-resource-hierarchy
```

2. Register the tool with Laravel Nova via the `tools` method of the `NovaServiceProvider`.

```
// in app/Providers/NovaServiceProvider.php

use BenColmer\NovaResourceHierarchy\ResourceHierarchy;

// ...

public function tools()
{
    return [
        // ...

        ResourceHierarchy::make(\App\Nova\MyResource::class),
    ];
}
```

Next, take a look through the available [configuration options](#configuration).

Configuration
-------------

[](#configuration)

Once you have registered the tool in Nova, you have several configuration options available:

### Customizing Model Keys

[](#customizing-model-keys)

Set the ID, Parent ID, and order column *(optional)* names for the underlying model of a resource.

```
public function tools()
{
    return [
        ResourceHierarchy::make(\App\Nova\MyResource::class),
+           ->keyNames('idColumnName', 'parentIdColumnName', 'orderColumnName')
    ];
}
```

### Enable Reordering

[](#enable-reordering)

Enables reordering of the resource hierarchy (this functionality is disabled by default).

```
public function tools()
{
    return [
        ResourceHierarchy::make(\App\Nova\MyResource::class),
+           ->enableReordering()
    ];
}
```

### Maximum Depth

[](#maximum-depth)

Set the maximum hierarchy depth.

By default, the maximum depth is 10.

```
public function tools()
{
    return [
        ResourceHierarchy::make(\App\Nova\MyResource::class),
+           ->maxDepth(3)
    ];
}
```

### Available Actions

[](#available-actions)

You can control which actions (Create, View, Update, and Delete) are available.

By default, the Create, View, Update, and Delete actions are available. These actions are protected by [authorization policies](https://nova.laravel.com/docs/v5/resources/authorization#policies).

```
public function tools()
{
    return [
        ResourceHierarchy::make(\App\Nova\MyResource::class),
+           ->actions(['create', 'view', 'update', 'delete'])
    ];
}
```

### Menu Entry

[](#menu-entry)

You can customize the menu entry title/icon:

```
public function tools()
{
    return [
        ResourceHierarchy::make(\App\Nova\MyResource::class),
+           ->menuTitle('This will be the menu title')
+           ->menuIcon('globe-alt')
    ];
}
```

Alternatively, you can hide the menu entry entirely:

```
public function tools()
{
    return [
        ResourceHierarchy::make(\App\Nova\MyResource::class),
+           ->hideMenu()
    ];
}
```

### Page Title/Description

[](#page-titledescription)

You can customize the title of the page and set a description.

```
public function tools()
{
    return [
        ResourceHierarchy::make(\App\Nova\MyResource::class),
+           ->pageTitle('Manage Hierarchy')
+           ->pageDescription('Manage the resource hierarchy below.')
    ];
}
```

### Item Title

[](#item-title)

You can customize the title of each item displayed in the hierarchy.

By default, the [resource title](https://nova.laravel.com/docs/v5/search/global-search#title-%2F-subtitle-attributes) will be displayed.

```
use Illuminate\Database\Eloquent\Model;

// ...

public function tools()
{
    return [
        ResourceHierarchy::make(\App\Nova\MyResource::class),
+           ->formatItemTitle(fn(Model $item) => implode(' - ', ([$item->id, $item->name])))
    ];
}
```

Authorization
-------------

[](#authorization)

This package uses Laravel's [authorization policies](https://nova.laravel.com/docs/v5/resources/authorization#policies) to check a user's Create / View / Update / Delete permissions.

You can also define one further authorization method to control whether a user is authorized to reorder the resource hierarchy:

1. Apply the `AuthorizesHierarchy` trait to your Nova resource:

```
// in app/Nova/MyResource.php

+ use BenColmer\NovaResourceHierarchy\Traits\AuthorizesHierarchy;

// ...

class MyResource extends Resource
{
+    use AuthorizesHierarchy;

    // ...
}
```

2. Define a `reorderHierarchy` method on your Policy class:

```
// in app/Policies/MyResourcePolicy.php

// ...

class MyResourcePolicy
{
+    /**
+     * Determine whether the user can reorder the hierarchy.
+     */
+    public function reorderHierarchy(User $user): bool
+    {
+        return true; // check if the user is authorized
+    }

    // ...
}
```

Localization &amp; Message Customization
----------------------------------------

[](#localization--message-customization)

The package translation files can be published using the following command:

```
php artisan vendor:publish --provider="BenColmer\NovaResourceHierarchy\ToolServiceProvider" --tag=translations
```

You can then edit these files to customize the messages as required.

Credits
-------

[](#credits)

- [Ben Colmer](https://github.com/bencolmer)
- [Ralph Huwiler (vue-nestable)](https://github.com/rhwilr/vue-nestable)
- [Artem Stepanenko (vue3-nestable)](https://github.com/stepanenko3/vue3-nestable)

License
-------

[](#license)

Nova Resource Hierarchy is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance55

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 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

302d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2b35214229c349af176065734509581603c542ee6811b6cfeee0d33ff52dc65a?d=identicon)[bencolmer](/maintainers/bencolmer)

---

Top Contributors

[![bencolmer](https://avatars.githubusercontent.com/u/72663325?v=4)](https://github.com/bencolmer "bencolmer (24 commits)")

---

Tags

laravel-novalaraveltreeresourcehierarchynova

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bencolmer-nova-resource-hierarchy/health.svg)

```
[![Health](https://phpackages.com/badges/bencolmer-nova-resource-hierarchy/health.svg)](https://phpackages.com/packages/bencolmer-nova-resource-hierarchy)
```

###  Alternatives

[cloudstudio/resource-generator

Resource Generator for Laravel Nova

106136.1k1](/packages/cloudstudio-resource-generator)[datomatic/nova-enum-field

A Laravel Nova PHP 8.1 enum field with filters

20134.2k](/packages/datomatic-nova-enum-field)[advoor/nova-editor-js

A Laravel Nova field bringing EditorJs magic to Nova.

92179.0k3](/packages/advoor-nova-editor-js)[simplesquid/nova-enum-field

A Laravel Nova field to add enums to resources.

52391.9k2](/packages/simplesquid-nova-enum-field)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57215.9k](/packages/sbine-route-viewer)[swooinc/nova-countdown

A countdown card for Laravel Nova.

1224.5k](/packages/swooinc-nova-countdown)

PHPackages © 2026

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