PHPackages                             fbpkg/laravel-rbac - 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. fbpkg/laravel-rbac

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

fbpkg/laravel-rbac
==================

A lightweight and flexible RBAC package for Laravel.

v0.1.0(today)10MITPHPPHP ^8.2

Since Jul 28Pushed todayCompare

[ Source](https://github.com/fbpkg/laravel-rbac)[ Packagist](https://packagist.org/packages/fbpkg/laravel-rbac)[ Docs](https://github.com/fbpkg/laravel-rbac)[ RSS](/packages/fbpkg-laravel-rbac/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

Laravel RBAC
============

[](#laravel-rbac)

A lightweight and flexible Role-Based Access Control (RBAC) package for Laravel.

Features
--------

[](#features)

- Lightweight and framework-friendly
- Role &amp; Permission management
- Polymorphic role assignments
- Configurable models and table names
- Configurable role types
- Laravel 11 &amp; 12 support
- PHP 8.2+

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

[](#installation)

Install the package using Composer:

```
composer require fbpkg/laravel-rbac
```

Publish the configuration file:

```
php artisan vendor:publish --tag=rbac-config
```

Publish the migrations:

```
php artisan vendor:publish --tag=rbac-migrations
```

Run the migrations:

```
php artisan migrate
```

Basic Usage
-----------

[](#basic-usage)

Add the `HasRoles` trait to your model:

```
use Fbpkg\Rbac\Traits\HasRoles;

class User extends Authenticatable
{
    use HasRoles;
}
```

Assign roles:

```
$user->assignRole('admin');
```

Check roles:

```
$user->hasRole('admin');
$user->hasAnyRole('admin', 'manager');
$user->hasAllRoles('admin', 'manager');
```

Assign permissions to a role:

```
$role->assignPermission('users.create');
```

Check permissions:

```
$user->hasPermission('users.create');
$user->hasAnyPermission('users.create', 'users.edit');
```

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

[](#configuration)

The package is fully configurable.

You can customize:

- Role model
- Permission model
- Table names
- Pivot table names
- Role type enum

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

[](#requirements)

- PHP 8.2+
- Laravel 11.x / 12.x

License
-------

[](#license)

This package is open-sourced software licensed under the MIT license.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance100

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/84567370?v=4)[Farzad Sharifi](/maintainers/farzadblack)[@farzadblack](https://github.com/farzadblack)

---

Top Contributors

[![farzadblack](https://avatars.githubusercontent.com/u/84567370?v=4)](https://github.com/farzadblack "farzadblack (8 commits)")

---

Tags

laravelauthorizationaclpermissionrolesrbacrolefbpkg

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/fbpkg-laravel-rbac/health.svg)

```
[![Health](https://phpackages.com/badges/fbpkg-laravel-rbac/health.svg)](https://phpackages.com/packages/fbpkg-laravel-rbac)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.5k](/packages/spatie-laravel-permission)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M348](/packages/psalm-plugin-laravel)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6765.1k6](/packages/hasinhayder-tyro)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M137](/packages/laravel-pulse)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M250](/packages/laravel-ai)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M134](/packages/roots-acorn)

PHPackages © 2026

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