PHPackages                             pktharindu/nova-permissions - 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. pktharindu/nova-permissions

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

pktharindu/nova-permissions
===========================

Laravel Nova Grouped Permissions (ACL)

v3.1.0(1y ago)136421.9k↓17.3%21[1 issues](https://github.com/pktharindu/nova-permissions/issues)MITPHPPHP &gt;=7.1.0|^8.0CI failing

Since Mar 23Pushed 1w ago3 watchersCompare

[ Source](https://github.com/pktharindu/nova-permissions)[ Packagist](https://packagist.org/packages/pktharindu/nova-permissions)[ GitHub Sponsors](https://github.com/pktharindu)[ RSS](/packages/pktharindu-nova-permissions/feed)WikiDiscussions master Synced 2d ago

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

Laravel Nova Grouped Permissions (RBAC)
=======================================

[](#laravel-nova-grouped-permissions-rbac)

[![banner that says Nova Permissions](https://raw.githubusercontent.com/pktharindu/nova-permissions/master/docs/social-preview.png)](https://raw.githubusercontent.com/pktharindu/nova-permissions/master/docs/social-preview.png)

[![GitHub](https://camo.githubusercontent.com/99561e5036895b9480ac062fe422dd64bc238725acd9f4e11db30c5d0feb70b9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f706b74686172696e64752f6e6f76612d7065726d697373696f6e732e7376673f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/99561e5036895b9480ac062fe422dd64bc238725acd9f4e11db30c5d0feb70b9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f706b74686172696e64752f6e6f76612d7065726d697373696f6e732e7376673f7374796c653d666f722d7468652d6261646765) [![Packagist](https://camo.githubusercontent.com/04d57009503d2067ec0371a0a49fc5ba80bea00f354c1cd4d8a31bd4c176512f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706b74686172696e64752f6e6f76612d7065726d697373696f6e732e7376673f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/04d57009503d2067ec0371a0a49fc5ba80bea00f354c1cd4d8a31bd4c176512f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706b74686172696e64752f6e6f76612d7065726d697373696f6e732e7376673f7374796c653d666f722d7468652d6261646765) [![Packagist](https://camo.githubusercontent.com/059208b02abf48a4dc59f7b0b29fe5d338d627704be0f8f170280f4591a3703c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706b74686172696e64752f6e6f76612d7065726d697373696f6e732e7376673f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/059208b02abf48a4dc59f7b0b29fe5d338d627704be0f8f170280f4591a3703c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706b74686172696e64752f6e6f76612d7065726d697373696f6e732e7376673f7374796c653d666f722d7468652d6261646765)

Add Permissions based authorization for your Nova installation via Role-Based Access Control (RBAC). Roles are defined in the database whereas Permissions are defined in the code base. It allows you to group your Permissions into Groups and attach it to Users.

&gt;= Nova 4v3.x&lt;= Nova 3v2.xIf you like this package, show some love by starring the repo. 🙏

This package is inspired by [Silvanite\\Brandenburg](https://github.com/Silvanite/brandenburg) as it has clear separation of concerns.

> *Roles* are defined in the *Database*

and

> *Permissions* are defined in the *Codebase*

As a result, you won't see any *Permissions* resource. The *Roles* resource will get the permissions from the Gates defined in your code.

- [Laravel Nova Grouped Permissions (RBAC)](#laravel-nova-grouped-permissions-rbac)
    - [Installation](#installation)
    - [Permissions with Groups](#permissions-with-groups)
        - [Index View](#index-view)
        - [Detail View](#detail-view)
        - [Edit View](#edit-view)
    - [Usage](#usage)
        - [Create a Model Policy](#create-a-model-policy)
    - [Customization](#customization)
        - [Use your own Resources](#use-your-own-resources)
    - [Support](#support)
    - [Credits](#credits)
    - [License](#license)

[![Tool Demo](https://raw.githubusercontent.com/pktharindu/nova-permissions/master/docs/preview-demo.gif)](https://raw.githubusercontent.com/pktharindu/nova-permissions/master/docs/preview-demo.gif)

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

[](#installation)

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

```
composer require pktharindu/nova-permissions
```

Publish the Configuration with the following command:

```
php artisan vendor:publish --provider="Pktharindu\NovaPermissions\ToolServiceProvider" --tag="config"
```

Configuration file includes some dummy permissions for your refference. Feel free to remove them and add your own permissions.

```
// in config/nova-permissions.php
