PHPackages                             dytechltd/nova-permission - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. dytechltd/nova-permission

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

dytechltd/nova-permission
=========================

A Laravel Nova tool for Spatie's Permission library.

2.7.4(4y ago)12.1kMITPHPPHP ^7.4|^8.0

Since Aug 23Pushed 4y agoCompare

[ Source](https://github.com/dytechltd/nova-permission)[ Packagist](https://packagist.org/packages/dytechltd/nova-permission)[ RSS](/packages/dytechltd-nova-permission/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (1)Versions (36)Used By (0)

A Laravel Nova tool for Spatie's laravel-permission library
===========================================================

[](#a-laravel-nova-tool-for-spaties-laravel-permission-library)

[![Latest Version on Packagist](https://camo.githubusercontent.com/924f1984bde03747b9cf51ac5f2713f0692b14427df6908fab552e3c9d8448d3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7679756c6461736865762f6e6f76612d7065726d697373696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vyuldashev/nova-permission)[![Total Downloads](https://camo.githubusercontent.com/bf0dbdeee8fef13f6f7954625a44450312303567716e29717f41304d6f7fd17a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7679756c6461736865762f6e6f76612d7065726d697373696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vyuldashev/nova-permission)

[![screenshot 1](https://raw.githubusercontent.com/vyuldashev/nova-permission/master/docs/user-resource.png)](https://raw.githubusercontent.com/vyuldashev/nova-permission/master/docs/user-resource.png)

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

[](#installation)

You can install the package in to a Laravel app that uses [Nova](https://nova.laravel.com) via composer:

```
composer require dytechltd/nova-permission
```

Go through the [Installation](https://github.com/spatie/laravel-permission#installation) section in order to setup [laravel-permission](https://packagist.org/packages/spatie/laravel-permission).

Next up, you must register the tool with Nova. This is typically done in the `tools` method of the `NovaServiceProvider`.

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

// ...

public function tools()
{
    return [
        // ...
        \Dytechltd\NovaPermission\NovaPermissionTool::make(),
    ];
}
```

Next, add middleware to `config/nova.php`

```
// in config/nova.php
'middleware' => [
    // ...
    \Dytechltd\NovaPermission\ForgetCachedPermissions::class,
],
```

Finally, add `MorphToMany` fields to you `app/Nova/User` resource:

```
// ...
use Laravel\Nova\Fields\MorphToMany;

public function fields(Request $request)
{
    return [
        // ...
        MorphToMany::make('Roles', 'roles', \Dytechltd\NovaPermission\Role::class),
        MorphToMany::make('Permissions', 'permissions', \Dytechltd\NovaPermission\Permission::class),
    ];
}
```

Or if you want to attach multiple permissions at once, use `RoleBooleanGroup` and `PermissionBooleanGroup` fields (requires at least Nova 2.6.0):

```
// ...
use Dytechltd\NovaPermission\PermissionBooleanGroup;
use Dytechltd\NovaPermission\RoleBooleanGroup;

public function fields(Request $request)
{
    return [
        // ...
        RoleBooleanGroup::make('Roles'),
        PermissionBooleanGroup::make('Permissions'),
    ];
}
```

If your `User` could have a single role at any given time, you can use `RoleSelect` field. This field will render a standard select where you can pick a single role from.

```
// ...
use Dytechltd\NovaPermission\PermissionBooleanGroup;
use Dytechltd\NovaPermission\RoleSelect;

public function fields(Request $request)
{
    return [
        // ...
        RoleSelect::make('Role', 'roles'),
    ];
}
```

Customization
-------------

[](#customization)

If you want to use custom resource classes you can define them when you register a tool:

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

// ...

public function tools()
{
    return [
        // ...
        \Dytechltd\NovaPermission\NovaPermissionTool::make()
            ->roleResource(CustomRole::class)
            ->permissionResource(CustomPermission::class),
    ];
}
```

If you want to show your roles and policies with a custom label, you can set `$labelAttribute` when instantiating your fields:

```
// ...
use Dytechltd\NovaPermission\PermissionBooleanGroup;
use Dytechltd\NovaPermission\RoleSelect;

public function fields(Request $request)
{
    return [
        // ...
        RoleBooleanGroup::make('Roles', 'roles', null, 'description'),
        PermissionBooleanGroup::make('Permissions', 'permissions', null, 'description'),
        RoleSelect::make('Role', 'roles', null, 'description'),
    ];
}
```

Define Policies
---------------

[](#define-policies)

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

// ...

public function tools()
{
    return [
        // ...
        \Dytechltd\NovaPermission\NovaPermissionTool::make()
            ->rolePolicy(RolePolicy::class)
            ->permissionPolicy(PermissionPolicy::class),
    ];
}
```

Usage
-----

[](#usage)

A new menu item called "Permissions &amp; Roles" will appear in your Nova app after installing this package.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 57.8% 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 ~35 days

Recently: every ~119 days

Total

35

Last Release

1620d ago

Major Versions

v1.9.0 → 2.0.02019-08-20

PHP version history (4 changes)v1.0.0PHP ^7.1.

v1.3.1PHP ^7.1

2.7.3PHP ^7.2|^8.0

2.7.4PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/8f39fefe694943326fcb6ce5c95285675530d0ac6014447958d0a2b69fccf15d?d=identicon)[DytechLyne](/maintainers/DytechLyne)

---

Top Contributors

[![vyuldashev](https://avatars.githubusercontent.com/u/1809081?v=4)](https://github.com/vyuldashev "vyuldashev (89 commits)")[![Dennis-Mwea](https://avatars.githubusercontent.com/u/22258295?v=4)](https://github.com/Dennis-Mwea "Dennis-Mwea (21 commits)")[![nalingia](https://avatars.githubusercontent.com/u/5793125?v=4)](https://github.com/nalingia "nalingia (6 commits)")[![Reflow1319](https://avatars.githubusercontent.com/u/6665500?v=4)](https://github.com/Reflow1319 "Reflow1319 (5 commits)")[![gnanakeethan](https://avatars.githubusercontent.com/u/2353181?v=4)](https://github.com/gnanakeethan "gnanakeethan (4 commits)")[![SiebeVE](https://avatars.githubusercontent.com/u/14889418?v=4)](https://github.com/SiebeVE "SiebeVE (3 commits)")[![shalawani](https://avatars.githubusercontent.com/u/7045417?v=4)](https://github.com/shalawani "shalawani (3 commits)")[![johnpaulmedina](https://avatars.githubusercontent.com/u/1139439?v=4)](https://github.com/johnpaulmedina "johnpaulmedina (2 commits)")[![IGedeon](https://avatars.githubusercontent.com/u/694313?v=4)](https://github.com/IGedeon "IGedeon (2 commits)")[![erhansogut](https://avatars.githubusercontent.com/u/1370493?v=4)](https://github.com/erhansogut "erhansogut (2 commits)")[![letrams](https://avatars.githubusercontent.com/u/6623497?v=4)](https://github.com/letrams "letrams (2 commits)")[![drbyte](https://avatars.githubusercontent.com/u/404472?v=4)](https://github.com/drbyte "drbyte (2 commits)")[![vincenzoraco](https://avatars.githubusercontent.com/u/5623078?v=4)](https://github.com/vincenzoraco "vincenzoraco (1 commits)")[![lucascolette](https://avatars.githubusercontent.com/u/829381?v=4)](https://github.com/lucascolette "lucascolette (1 commits)")[![dercodercom](https://avatars.githubusercontent.com/u/16963738?v=4)](https://github.com/dercodercom "dercodercom (1 commits)")[![dividy](https://avatars.githubusercontent.com/u/19650505?v=4)](https://github.com/dividy "dividy (1 commits)")[![dnwjn](https://avatars.githubusercontent.com/u/57711725?v=4)](https://github.com/dnwjn "dnwjn (1 commits)")[![fkeloks](https://avatars.githubusercontent.com/u/16477784?v=4)](https://github.com/fkeloks "fkeloks (1 commits)")[![astalpaert](https://avatars.githubusercontent.com/u/5843790?v=4)](https://github.com/astalpaert "astalpaert (1 commits)")[![marcorivm](https://avatars.githubusercontent.com/u/1222598?v=4)](https://github.com/marcorivm "marcorivm (1 commits)")

---

Tags

laravelnovaspatie-permission

### Embed Badge

![Health badge](/badges/dytechltd-nova-permission/health.svg)

```
[![Health](https://phpackages.com/badges/dytechltd-nova-permission/health.svg)](https://phpackages.com/packages/dytechltd-nova-permission)
```

###  Alternatives

[vyuldashev/nova-permission

A Laravel Nova tool for Spatie's Permission library.

4332.5M3](/packages/vyuldashev-nova-permission)[kiritokatklian/nova-permission

A Laravel Nova tool for Spatie's Permission library.

791.1M3](/packages/kiritokatklian-nova-permission)[sereny/nova-permissions

Laravel Nova - Roles &amp; Permissions

86388.6k1](/packages/sereny-nova-permissions)[itsmejoshua/novaspatiepermissions

Laravel Nova tool for managing spaties roles/permissions in laravel's nova package.

30262.5k](/packages/itsmejoshua-novaspatiepermissions)

PHPackages © 2026

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