PHPackages                             jhonoryza/filament-simple-role-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. jhonoryza/filament-simple-role-permission

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

jhonoryza/filament-simple-role-permission
=========================================

filament scaffolding for role and permission

0.0.5(9mo ago)424MITPHPPHP ^8.2

Since Jul 29Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/jhonoryza/filament-simple-role-permission)[ Packagist](https://packagist.org/packages/jhonoryza/filament-simple-role-permission)[ RSS](/packages/jhonoryza-filament-simple-role-permission/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

Simple Role Permission Filament
===============================

[](#simple-role-permission-filament)

 [ ![Total Downloads](https://camo.githubusercontent.com/4eebb485f27cb7f68bbb724f2961b4fe1100a0f4ff22c1025323ce67d7fe0b5c/68747470733a2f2f706f7365722e707567782e6f72672f6a686f6e6f72797a612f66696c616d656e742d73696d706c652d726f6c652d7065726d697373696f6e2f642f746f74616c2e737667) ](https://packagist.org/packages/jhonoryza/filament-simple-role-permission) [ ![Latest Stable Version](https://camo.githubusercontent.com/774840c2a0c5f2649fbc42213fa828a0262c60773488c88f4a93e9fb25d69169/68747470733a2f2f706f7365722e707567782e6f72672f6a686f6e6f72797a612f66696c616d656e742d73696d706c652d726f6c652d7065726d697373696f6e2f762f737461626c652e737667) ](https://packagist.org/packages/jhonoryza/filament-simple-role-permission) [ ![License](https://camo.githubusercontent.com/942ed150495f21bd896d74a20acf35147e0fcc5cf994929d9e8c510baf509f74/68747470733a2f2f706f7365722e707567782e6f72672f6a686f6e6f72797a612f66696c616d656e742d73696d706c652d726f6c652d7065726d697373696f6e2f6c6963656e73652e737667) ](https://packagist.org/packages/jhonoryza/filament-simple-role-permission)

This package is a filament scaffolding for simple role and permission, provides filament resources, models, migration, seeder and policy generator

Screenshot
----------

[](#screenshot)

 [![](/public/create-role.png)](/public/create-role.png) [![](/public/role.png)](/public/role.png)

 [![](/public/create-permission.png)](/public/create-permission.png) [![](/public/permission.png)](/public/permission.png)

ERD
---

[](#erd)

 [![](/public/erd.png)](/public/erd.png)

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2
- Laravel &gt;= 10.0
- Filament &gt;= 3.0

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

[](#installation)

You can install the package via composer

```
composer require --dev jhonoryza/filament-simple-role-permission
```

Then you need to run this command to publish the scaffolding

```
php artisan filament-simple-role-permission:install
```

Then you can migrate your database

```
php artisan migrate
```

Edit `app\Models\User.php` add `HasRole` trait and `predefined roles`

```
use App\Models\Concern\HasRole;
class User extends Authenticatable
{
    use HasRole;

    const SUPER = 'super-admin';

    const ADMIN = 'admin';

    public static function getPredefined(): array
    {
        return [
            self::SUPER,
            self::ADMIN,
        ];
    }

    protected $fillable = [
        // ... etc

        'role_id',
    ]
}
```

`const SUPER` is used in `UserSeeder` class

Then seed it with some default role and permission

```
php artisan db:seed --class=PermissionSeeder
php artisan db:seed --class=RoleSeeder
php artisan db:seed --class=UserSeeder
```

Then generate all policy file in `app\Policies` directory base on `predefined` permissions from Permission model

```
php artisan policy:generate
```

Configuration
-------------

[](#configuration)

You can configure predefined permissions by adjust `function getPredefined()` and `function match()` in `Permission` model class like this

```
public static function getPredefined(): array
{
    return [
        'users' => [
            'view-any',
            'view',
            'create',
            'update',
            'delete',
            'bulk-delete',
        ],
        'roles' => [
            'view-any',
            'view',
            'create',
            'update',
            'delete',
            'bulk-delete',
        ],
        'permissions' => [
            'view-any',
            'view',
            'create',
            'update',
            'delete',
            'bulk-delete',
        ],
    ];
}

public static function match($permission): string
{
    return match ($permission) {
        'view-any' => 'viewAnyPermission',
        'view' => 'viewPermission',
        'create' => 'createPermission',
        'update' => 'updatePermission',
        'delete' => 'deletePermission',
        'bulk-delete' => 'bulkDeletePermission',
        default => '',
    };
}
```

Publishing policy stubs
-----------------------

[](#publishing-policy-stubs)

To customize Policy class template:

```
php artisan vendor:publish --tag="simple-role-permission-stubs"
```

Security
--------

[](#security)

If you discover any security related issues, please create an issue.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance56

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~91 days

Total

5

Last Release

289d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b350bd59744652aada177f2b11c36297774540fadd91f1f41fbfc0bd79e0886?d=identicon)[jhonoryza](/maintainers/jhonoryza)

---

Top Contributors

[![jhonoryza](https://avatars.githubusercontent.com/u/5910636?v=4)](https://github.com/jhonoryza "jhonoryza (14 commits)")

---

Tags

filamentphplaravellivewirepermissionrole

### Embed Badge

![Health badge](/badges/jhonoryza-filament-simple-role-permission/health.svg)

```
[![Health](https://phpackages.com/badges/jhonoryza-filament-simple-role-permission/health.svg)](https://phpackages.com/packages/jhonoryza-filament-simple-role-permission)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[olssonm/l5-very-basic-auth

Laravel stateless HTTP basic auth without the need for a database

1662.5M1](/packages/olssonm-l5-very-basic-auth)[stechstudio/laravel-jwt

Helper package that makes it easy to generate, consume, and protect routes with JWT tokens in Laravel

126117.6k](/packages/stechstudio-laravel-jwt)[scaler-tech/laravel-saml2

SAML2 Service Provider integration for Laravel applications, based on OneLogin toolkit

2737.5k](/packages/scaler-tech-laravel-saml2)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)

PHPackages © 2026

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