PHPackages                             lfcuser/laravel-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. lfcuser/laravel-role-permission

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

lfcuser/laravel-role-permission
===============================

Laravel package for role and permission management

v1.0.0(1mo ago)01MITPHPPHP ^8.2

Since Jul 6Pushed 1mo agoCompare

[ Source](https://github.com/lfcuser/LaravelRolePermission)[ Packagist](https://packagist.org/packages/lfcuser/laravel-role-permission)[ RSS](/packages/lfcuser-laravel-role-permission/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

LaravelRolePermission
=====================

[](#laravelrolepermission)

Simple Roles-Permissions Managment package for Laravel ^11 and php ^8.2

Setup
-----

[](#setup)

Install

```
composer require lfcuser/laravel-role-permission

```

Do

```
php artisan vendor:publish --tag=laravel-role-permission-config
``

Update laravel-role-permission.php for your project

Add \Lfcuser\LaravelRolePermission\Middleware\RolePermissionMiddleware on your middleware chain
OR extend your BaseController from \Lfcuser\LaravelRolePermission\Http\Controllers\AccessResourceController

Add API if you need:

```

Route::group(\[ 'prefix' =&gt; 'permission\_roles', 'controller' =&gt; \\Lfcuser\\LaravelRolePermission\\Http\\Controllers\\RolePermissionController::class, \], function () { Route::get('/list', 'index')-&gt;name('permission\_roles\_get\_list'); Route::post('/change\_access', 'changeAccess')-&gt;name('permission\_roles\_change\_access'); Route::get('/item', 'show')-&gt;name('permission\_roles\_get\_item'); Route::get('/thesaurus/roles', 'roles')-&gt;name('permission\_roles\_get\_roles'); Route::get('/thesaurus/permissions', 'permissions')-&gt;name('permission\_roles\_get\_permissions'); });

```

## UI Example
https://github.com/lfcuser/LaravelRolePermissionPage

## Explanation
There are exactly two places in the project where roles are needed—in the table for associating roles with user entities and in the code for verifying roles.
On top of that, roles are rarely added or changed. Therefore, it’s sufficient to store roles in the configuration.

Permissions are resources to which access rights are granted for roles. These resources are defined in the program code: API routes, file types, report types, and so on. There’s no point in moving them to the database either. This is because you can’t create a resource without modifying the code anyway, and making a query to retrieve something the developer already has in the code is redundant.

It makes sense to store the mapping between permissions and roles in the database. In this library, the structure of the single table is denormalized. The `permission_roles` table stores the resource as the primary key and an array of roles that have access to that resource.
As a result, under the hood, API access checking looks something like this:

```

Access::can($request-&gt;user()-&gt;$roleProperty, Access::getPermission($request-&gt;route()-&gt;getName())) ... in\_array($role, $permissionRole?-&gt;roles)

```
We take the entity associated with the role, retrieve the resource, and check whether the user’s role is among the roles defined for that resource

```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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

Unknown

Total

1

Last Release

48d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/51206157?v=4)[LFC](/maintainers/Lfcuser)[@lfcuser](https://github.com/lfcuser)

---

Top Contributors

[![lfcuser](https://avatars.githubusercontent.com/u/51206157?v=4)](https://github.com/lfcuser "lfcuser (7 commits)")

---

Tags

laravelrolespermissions

### Embed Badge

![Health badge](/badges/lfcuser-laravel-role-permission/health.svg)

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

###  Alternatives

[hasinhayder/tyro

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

6796.8k7](/packages/hasinhayder-tyro)[beatswitch/lock-laravel

A Laravel Driver for Lock.

15429.9k1](/packages/beatswitch-lock-laravel)[erag/laravel-role-permission

A simple and easy-to-install role and permission management package for Laravel, supporting versions 10.x and 11.x

404.2k](/packages/erag-laravel-role-permission)

PHPackages © 2026

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