PHPackages                             fullstackllc/novaspatiepermissions - 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. fullstackllc/novaspatiepermissions

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

fullstackllc/novaspatiepermissions
==================================

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

v1.1.0(1y ago)01.1k—3.8%MITPHPPHP ^8.0

Since May 30Pushed 1y agoCompare

[ Source](https://github.com/Fullstack-LLC/novaspatiepermissions)[ Packagist](https://packagist.org/packages/fullstackllc/novaspatiepermissions)[ RSS](/packages/fullstackllc-novaspatiepermissions/feed)WikiDiscussions main Synced 1mo ago

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

A Laravel Nova tool for the Spatie Permission package
=====================================================

[](#a-laravel-nova-tool-for-the-spatie-permission-package)

[![License](https://camo.githubusercontent.com/77e59ad09637e33d93eaf8f919a7ea320429d28549392353c88e2b989176df30/68747470733a2f2f706f7365722e707567782e6f72672f46756c6c737461636b6c6c632f6e6f76617370617469657065726d697373696f6e732f6c6963656e7365)](https://packagist.org/packages/insenseanalytics/laravel-nova-permission)[![Latest Stable Version](https://camo.githubusercontent.com/c709c1ee2ad1e20444ad828022b6f6cd53b1fd692db5f9b94f051c31afae0ee4/68747470733a2f2f706f7365722e707567782e6f72672f46756c6c737461636b6c6c632f6e6f76617370617469657065726d697373696f6e732f762f737461626c65)](https://packagist.org/packages/Fullstackllc/novaspatiepermissions)[![Total Downloads](https://camo.githubusercontent.com/06a5b3563a7d76629bf6702f812b22c43c59a04f289e2197fb9fb1a322a92e79/68747470733a2f2f706f7365722e707567782e6f72672f46756c6c737461636b6c6c632f6e6f76617370617469657065726d697373696f6e732f646f776e6c6f616473)](https://packagist.org/packages/Fullstackllc/novaspatiepermissions)

This [Nova](https://nova.laravel.com) tool lets you:

- manage roles and permissions on the Nova dashboard
- use permissions based authorization for Nova resources

Screenshots
-----------

[](#screenshots)

Requirements &amp; Dependencies
-------------------------------

[](#requirements--dependencies)

There are no PHP dependencies except the [Laravel Nova](https://nova.laravel.com) v4 package and the [Spatie Permission](https://github.com/spatie/laravel-permission) v5 package.

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

[](#installation)

You can install this tool into a Laravel app that uses [Nova](https://nova.laravel.com) via composer:

```
composer require fullstackllc/novaspatiepermissions
```

Next, if you do not have package discovery enabled, you need to register the provider in the `config/app.php` file.

```
'providers' => [
    ...,
    Fullstackllc\Novaspatiepermissions\NovaSpatiePermissionsServiceProvider::class,
]
```

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

```
// in app/Providers/NovaServiceProvider.php
use Fullstackllc\Novaspatiepermissions\Novaspatiepermissions;

public function tools()
{
    return [
        // ...
        Novaspatiepermissions::make(),
    ];
}
```

Next, add `MorphToMany` fields to your `app/Nova/User` resource:

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

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

Finally, add the `ForgetCachedPermissions` class to your `config/nova.php` middleware like so:

```
// in config/nova.php
'middleware' => [
	'web',
	Authenticate::class,
	DispatchServingNovaEvent::class,
	BootTools::class,
	Authorize::class,
	 \Fullstackllc\Novaspatiepermissions\ForgetCachedPermissions::class,
],
```

Localization
------------

[](#localization)

You can use the artisan command line tool to publish localization files:

```
php artisan vendor:publish --provider=" \Fullstackllc\Novaspatiepermissions\NovaPermissionServiceProvider"
```

Permissions Based Authorization for Nova Resources
--------------------------------------------------

[](#permissions-based-authorization-for-nova-resources)

By default, Laravel Nova uses Policy based authorization for Nova resources. If you are using the Spatie Permission library, it is very likely that you would want to swap this out to permission based authorization without the need to define Authorization policies.

To do so, you can use the `PermissionsBasedAuthTrait` and define a `permissionsForAbilities` static array property in your Nova resource class like so:

```
// in app/Nova/YourNovaResource.php

class YourNovaResource extends Resource
{
    use \Fullstackllc\Novaspatiepermissions\PermissionsBasedAuthTrait;

    public static $permissionsForAbilities = [
      'all' => 'manage products',
    ];
}
```

The example above means that all actions on this resource can be performed by users who have the "manage products" permission. You can also define separate permissions for each action like so:

```
    public static $permissionsForAbilities = [
      'viewAny' => 'view products',
      'view' => 'view products',
      'create' => 'create products',
      'update' => 'update products',
      'delete' => 'delete products',
      'restore' => 'restore products',
      'forceDelete' => 'forceDelete products',
      'addAttribute' => 'add product attributes',
      'attachAttribute' => 'attach product attributes',
      'detachAttribute' => 'detach product attributes',
    ];
```

### Relationships

[](#relationships)

To allow your users to specify a relationship on your model, you will need to add another permission on the Model. For example, if your `Product` belongs to `User`, add the following permission on `app/Nova/User.php`. :

```
    public static $permissionsForAbilities = [
      'addProduct' => 'add user on products'
    ];
```

Contributing
------------

[](#contributing)

Contributions are welcome, explain the issue/feature that you want to solve/add and back your code up with tests. Happy coding!

License
-------

[](#license)

This package was originally developed by  however they have abandoned the package. The MIT License (MIT). Please see [License File](LICENSE.txt) for more information.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance46

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 82.1% 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 ~313 days

Total

2

Last Release

404d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bee8d0a3a7ed351b1b7617c1005dabcdd7c6b7587eed32ae80a4939064327d2e?d=identicon)[dchurch](/maintainers/dchurch)

---

Top Contributors

[![moroneyio](https://avatars.githubusercontent.com/u/78652562?v=4)](https://github.com/moroneyio "moroneyio (23 commits)")[![jdc1898](https://avatars.githubusercontent.com/u/3174628?v=4)](https://github.com/jdc1898 "jdc1898 (2 commits)")[![ijpatricio](https://avatars.githubusercontent.com/u/26031459?v=4)](https://github.com/ijpatricio "ijpatricio (1 commits)")[![roarkmccolgan](https://avatars.githubusercontent.com/u/1567162?v=4)](https://github.com/roarkmccolgan "roarkmccolgan (1 commits)")[![scouser03](https://avatars.githubusercontent.com/u/35454401?v=4)](https://github.com/scouser03 "scouser03 (1 commits)")

---

Tags

spatielaravelpermissionsnova

### Embed Badge

![Health badge](/badges/fullstackllc-novaspatiepermissions/health.svg)

```
[![Health](https://phpackages.com/badges/fullstackllc-novaspatiepermissions/health.svg)](https://phpackages.com/packages/fullstackllc-novaspatiepermissions)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[itsmejoshua/novaspatiepermissions

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

30262.5k](/packages/itsmejoshua-novaspatiepermissions)[pktharindu/nova-permissions

Laravel Nova Grouped Permissions (ACL)

136387.1k](/packages/pktharindu-nova-permissions)[sereny/nova-permissions

Laravel Nova - Roles &amp; Permissions

86388.6k1](/packages/sereny-nova-permissions)[insenseanalytics/laravel-nova-permission

A Laravel Nova tool for Spatie's Permission library.

7549.0k](/packages/insenseanalytics-laravel-nova-permission)[wijzijnweb/laravel-inertia-permissions

Easy to use package to implement Spatie's Permissions package into Inertia Laravel projects.

193.9k](/packages/wijzijnweb-laravel-inertia-permissions)

PHPackages © 2026

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