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

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

moonshine/permissions
=====================

User permissions for MoonShine

3.0.0(6mo ago)98.0k—10%5[1 issues](https://github.com/moonshine-software/permissions/issues)MITPHPPHP ^8.1|^8.2CI passing

Since Oct 29Pushed 6mo ago2 watchersCompare

[ Source](https://github.com/moonshine-software/permissions)[ Packagist](https://packagist.org/packages/moonshine/permissions)[ Docs](https://moonshine-laravel.com)[ RSS](/packages/moonshine-permissions/feed)WikiDiscussions 3.x Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (13)Used By (0)

MoonShine Permission
--------------------

[](#moonshine-permission)

### Requirements

[](#requirements)

- MoonShine v4.0+

### Support MoonShine versions

[](#support-moonshine-versions)

MoonShineChangeLog2.0+1.0+3.0+2.0+4.0+3.0+### Installation

[](#installation)

```
composer require moonshine/permissions
```

### Run migrations

[](#run-migrations)

```
php artisan migrate
```

### Get started

[](#get-started)

1. Change `MoonshineUser` model in **config/moonshine.php** or in `MoonShineServiceProvider`.

```
use MoonShine\Permissions\Models\MoonshineUser;

return [
    // ...
    'auth' => [
        // ...
        'providers' => [
            'moonshine' => [
                'driver' => 'eloquent',
                'model' => MoonshineUser::class,
            ],
        ],
    ],
];
```

Or add trait `HasMoonShinePermissions` to user model.

```
use MoonShine\Permissions\Traits\HasMoonShinePermissions;

class MoonshineUser extends Model
{
    use HasMoonShinePermissions;
}
```

2. Add trait `WithPermissions` to `MoonShineUserResource` and change `$model`.

```
use MoonShine\Permissions\Traits\WithPermissions;

class MoonShineUserResource extends ModelResource
{
    use WithPermissions;

    public string $model = MoonShine\Permissions\Models\MoonshineUser::class;

    // ...
}
```

### Example of condition to display in menu

[](#example-of-condition-to-display-in-menu)

```
use MoonShine\Support\Enums\Ability;

protected function menu(): array
{
    return [
        MenuItem::make('Posts', PostResource::class)
            ->canSee(fn () => auth()->user()->isHavePermission(PostResource::class, Ability::VIEW)),
    ];
}
```

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance65

Regular maintenance activity

Popularity33

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 65.7% 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 ~60 days

Recently: every ~66 days

Total

13

Last Release

205d ago

Major Versions

1.x-dev → 2.0.02024-10-13

2.x-dev → 3.0.02025-10-25

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1861327?v=4)[Danil Shutsky](/maintainers/lee-to)[@lee-to](https://github.com/lee-to)

---

Top Contributors

[![lee-to](https://avatars.githubusercontent.com/u/1861327?v=4)](https://github.com/lee-to "lee-to (23 commits)")[![shevl-dev](https://avatars.githubusercontent.com/u/118539450?v=4)](https://github.com/shevl-dev "shevl-dev (5 commits)")[![TheForwardDev](https://avatars.githubusercontent.com/u/167892602?v=4)](https://github.com/TheForwardDev "TheForwardDev (5 commits)")[![den1a](https://avatars.githubusercontent.com/u/45651923?v=4)](https://github.com/den1a "den1a (1 commits)")[![khlystou](https://avatars.githubusercontent.com/u/17690542?v=4)](https://github.com/khlystou "khlystou (1 commits)")

---

Tags

permissionsmoonshine

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/moonshine-permissions/health.svg)

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

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k89.8M1.0k](/packages/spatie-laravel-permission)[santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

2.3k5.4M43](/packages/santigarcor-laratrust)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[jeremykenedy/laravel-roles

A Powerful package for handling roles and permissions in Laravel. Supports Laravel 5.3 up to 12.

1.0k826.8k7](/packages/jeremykenedy-laravel-roles)[beatswitch/lock

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)[pktharindu/nova-permissions

Laravel Nova Grouped Permissions (ACL)

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

PHPackages © 2026

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