PHPackages                             yadahan/nova-bouncer - 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. yadahan/nova-bouncer

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

yadahan/nova-bouncer
====================

A Laravel Nova tool for managing Bouncer roles and abilities.

v2.1.0(1y ago)26129.6k↑75%10[2 issues](https://github.com/yadahan/nova-bouncer/issues)[1 PRs](https://github.com/yadahan/nova-bouncer/pulls)MITPHPPHP ^7.3|^8.0

Since Oct 12Pushed 1y ago2 watchersCompare

[ Source](https://github.com/yadahan/nova-bouncer)[ Packagist](https://packagist.org/packages/yadahan/nova-bouncer)[ RSS](/packages/yadahan-nova-bouncer/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (2)Versions (19)Used By (0)

Nova Bouncer
============

[](#nova-bouncer)

[![StyleCI](https://camo.githubusercontent.com/1be608df850889bb2579e5fd1b9da86b938fe0e50fd4032673a7a53ba1270fa7/68747470733a2f2f7374796c6563692e696f2f7265706f732f3135323134343430302f736869656c643f6272616e63683d6d6173746572267374796c653d666c6174)](https://styleci.io/repos/152144400)[![Total Downloads](https://camo.githubusercontent.com/8324020f569ab1548e6e25ddcafed5b84427c95f08e702963c140daa03b3ae1a/68747470733a2f2f706f7365722e707567782e6f72672f7961646168616e2f6e6f76612d626f756e6365722f646f776e6c6f6164733f666f726d61743d666c6174)](https://packagist.org/packages/yadahan/nova-bouncer)[![GitHub license](https://camo.githubusercontent.com/f48f8d6cf609f5b181b9c3218a85175fe8a5809c7ea400347f39697a5d55065d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c6174)](https://raw.githubusercontent.com/yadahan/nova-bouncer/master/LICENSE.md)

Use the power of [Bouncer](https://github.com/JosephSilber/bouncer) within your [Nova](https://nova.laravel.com) administration panel.

  ![Nova Bouncer screenshot](https://raw.githubusercontent.com/yadahan/nova-bouncer/master/screenshot-light.png)Installation
------------

[](#installation)

> **Note**
>
> Nova Bouncer requires laravel/nova ^4.0 and silber/bouncer ^1.0.

You may use Composer to install Nova Bouncer into your Laravel project:

```
composer require yadahan/nova-bouncer

```

### Configuration

[](#configuration)

After installing the Nova Bouncer, you need to register the tool with Nova in `app/Providers/NovaServiceProvder.php` file:

```
public function tools()
{
    return [
        // ...
        new \Yadahan\BouncerTool\BouncerTool,
    ];
}
```

Next, add the Roles and Abilities `MorphToMany` fields to your User resource in `app/Nova/User.php` file:

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

public function fields(Request $request)
{
    return [
        // ...
        MorphToMany::make('Roles', 'roles', 'Yadahan\BouncerTool\Nova\Role')->fields(function () {
            return [
                Text::make('Scope')
                    ->sortable()
                    ->rules('nullable', 'integer'),
            ];
        }),

        MorphToMany::make('Abilities', 'abilities', 'Yadahan\BouncerTool\Nova\Ability')
            ->fields(new \Yadahan\BouncerTool\Nova\PermissionsFields),
    ];
}
```

Finally, publish the Nova Bouncer config using the `vendor:publish` Artisan command:

```
php artisan vendor:publish --provider="Yadahan\BouncerTool\BouncerToolServiceProvider"

```

After publishing the config, you may define the models and abilities that you want to manage, in `config/bouncer-tool.php` file:

```
'actions' => [
    '*' => 'Manage',
    'viewAny' => 'View Any',
    'view' => 'View',
    'create' => 'Create',
    'update' => 'Update',
    'replicate' => 'Replicate',
    'delete' => 'Delete',
    'restore' => 'Restore',
    'forceDelete' => 'Force Delete',
    'runAction' => 'Run Action',
    'runDestructiveAction' => 'Run Destructive Action',
],

'entities' => [
    'User' => App\Models\User::class,
],
```

### Basic Usage

[](#basic-usage)

A new section (Bouncer) will appear in your Nova navigation menu.

> **Warning**
>
> Only users who are authorized to manage the Bouncer models can see this navigation section.

You may give ability to manage the Bouncer models for a user or role:

```
$user = User::find(1);

Bouncer::allow($user)->toManage(\Silber\Bouncer\Database\Role::class);
Bouncer::allow($user)->toManage(\Silber\Bouncer\Database\Ability::class);

// or

$role = Bouncer::role()->create(['name' => 'manage-bouncer']);

Bouncer::allow($role)->toManage(\Silber\Bouncer\Database\Role::class);
Bouncer::allow($role)->toManage(\Silber\Bouncer\Database\Ability::class);

$user->assign($role);
```

Laravel Authorization
---------------------

[](#laravel-authorization)

### Generating Policies

[](#generating-policies)

You may generate a policy using the `make:policy` artisan command:

```
php artisan make:policy UserPolicy --model=User

```

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

[](#contributing)

Thank you for considering contributing to the Nova Bouncer.

License
-------

[](#license)

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

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 94.3% 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 ~132 days

Recently: every ~256 days

Total

18

Last Release

566d ago

Major Versions

v0.10.1 → v1.0.02022-02-23

v1.0.0 → v2.0.02022-05-22

1.x-dev → v2.0.12022-05-29

PHP version history (3 changes)v0.1.0PHP ^7.1.3

v0.7.0PHP ^7.2|^8.0

v2.0.0PHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/78014421577122fe30272450747d773c44e88d3f697e13faf92d233d8a7b4880?d=identicon)[yadahan](/maintainers/yadahan)

---

Top Contributors

[![yakidahan](https://avatars.githubusercontent.com/u/7757560?v=4)](https://github.com/yakidahan "yakidahan (33 commits)")[![k8n](https://avatars.githubusercontent.com/u/272018?v=4)](https://github.com/k8n "k8n (1 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

bouncerlaravellaravel-novanovapermissionslaravelnovabouncer

### Embed Badge

![Health badge](/badges/yadahan-nova-bouncer/health.svg)

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

###  Alternatives

[vyuldashev/nova-permission

A Laravel Nova tool for Spatie's Permission library.

4302.6M3](/packages/vyuldashev-nova-permission)[kabbouchi/nova-impersonate

A Laravel Nova field allows you to authenticate as your users.

2342.2M](/packages/kabbouchi-nova-impersonate)[kiritokatklian/nova-permission

A Laravel Nova tool for Spatie's Permission library.

791.2M4](/packages/kiritokatklian-nova-permission)[sereny/nova-permissions

Laravel Nova - Roles &amp; Permissions

87455.9k1](/packages/sereny-nova-permissions)[visanduma/nova-two-factor

Nova Two Factor Authentication

58665.0k](/packages/visanduma-nova-two-factor)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17878.9k](/packages/markwalet-nova-modal-response)

PHPackages © 2026

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