PHPackages                             get-things-done/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. get-things-done/nova-permission

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

get-things-done/nova-permission
===============================

A Laravel Nova tool for Spatie's Permission library.

01PHP

Since Sep 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/get-things-done/nova-permission)[ Packagist](https://packagist.org/packages/get-things-done/nova-permission)[ RSS](/packages/get-things-done-nova-permission/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (1)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/994736b216758b4907efcd57dd8f3e64b6d504f7cbb1823614c199ab7798571b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6765742d7468696e67732d646f6e652f6e6f76612d7065726d697373696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/get-things-done/nova-permission)[![Total Downloads](https://camo.githubusercontent.com/1f9e6482ae8e861899f60ecf7bb39cedc7876adf60ea760f0d486e63b991af2a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6765742d7468696e67732d646f6e652f6e6f76612d7065726d697373696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/get-things-done/nova-permission)

[![screenshot 1](https://raw.githubusercontent.com/get-things-done/nova-permission/master/docs/user-resource.png)](https://raw.githubusercontent.com/get-things-done/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 get-things-done/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 [
        // ...
        \GetThingDone\NovaPermission\NovaPermissionTool::make(),
    ];
}
```

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

```
// in config/nova.php
'middleware' => [
    // ...
    \GetThingDone\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', \GetThingDone\NovaPermission\Role::class),
        MorphToMany::make('Permissions', 'permissions', \GetThingDone\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 GetThingDone\NovaPermission\PermissionBooleanGroup;
use GetThingDone\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 GetThingDone\NovaPermission\PermissionBooleanGroup;
use GetThingDone\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 [
        // ...
        \GetThingDone\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 GetThingDone\NovaPermission\PermissionBooleanGroup;
use GetThingDone\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 [
        // ...
        \GetThingDone\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

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17726941?v=4)[Cao Minh Duc](/maintainers/cao-minh-duc)[@cao-minh-duc](https://github.com/cao-minh-duc)

---

Top Contributors

[![cao-minh-duc](https://avatars.githubusercontent.com/u/17726941?v=4)](https://github.com/cao-minh-duc "cao-minh-duc (1 commits)")

### Embed Badge

![Health badge](/badges/get-things-done-nova-permission/health.svg)

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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