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

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

yusronarif/laravel-rbac
=======================

Permission handling for Laravel 5.8 and up

v2.0.0(6y ago)020MITPHPPHP ^7.2CI failing

Since Oct 2Pushed 6y ago1 watchersCompare

[ Source](https://github.com/yusronarif/laravel-rbac)[ Packagist](https://packagist.org/packages/yusronarif/laravel-rbac)[ Docs](https://github.com/yusronarif/laravel-rbac)[ RSS](/packages/yusronarif-laravel-rbac/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (8)Versions (4)Used By (0)

Associate users with permissions and roles
==========================================

[](#associate-users-with-permissions-and-roles)

### Origin Sources

[](#origin-sources)

Origin forked from [`spatie/laravel-permission`](https://github.com/spatie/laravel-permission)

[![Software License](https://camo.githubusercontent.com/a6fcaf837628e706ba1809e06a6cab6a1b8c87dbc1509d48c72273a34d1303c2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f797573726f6e617269662f6c61726176656c2d726261633f636f6c6f723d677265656e2d6c69676874266c6f676f3d676974687562267374796c653d666c61742d737175617265)](LICENSE)[![Latest Version](https://camo.githubusercontent.com/c90cbc27dc9ef512a769890b124c5d3986921999dabec69332c4f9394bf4a185/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f797573726f6e617269662f6c61726176656c2d726261632e7376673f6c6f676f3d676974687562267374796c653d666c61742d73717561726526736f72743d73656d766572)](https://github.com/yusronarif/laravel-rbac/releases)[![Packagist Version](https://camo.githubusercontent.com/02884c061406d1987ba2884ecd4ea6eded585284be21f35ff8d2730387a7a67d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f797573726f6e617269662f6c61726176656c2d726261633f6c6f676f3d636f6d706f736572267374796c653d666c61742d73717561726526736f72743d73656d766572)](https://packagist.org/packages/yusronarif/laravel-rbac)[![Build Status](https://camo.githubusercontent.com/edfe7a2b08d335f0df47282e922c5f70116b4a7315a4d53b71a53d079c46ae66/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f797573726f6e617269662f6c61726176656c2d726261632f6d61737465722e7376673f6c6f676f3d7472617669732d6369267374796c653d666c61742d737175617265)](https://travis-ci.org/yusronarif/laravel-rbac)[![StyleCI](https://camo.githubusercontent.com/894b45791761f1d639e4dfafa183f40371cd3b31f6b53be0fb99b59c596f2080/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3231323233363934342f736869656c64)](https://github.styleci.io/repos/212236944)[![Total Downloads](https://camo.githubusercontent.com/3a5334e0795ab34c07c29a12196d49d9eac976832470c3253fc118c62232cda8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f797573726f6e617269662f6c61726176656c2d726261633f6c6f676f3d636f6d706f736572267374796c653d666c61742d737175617265)](https://packagist.org/packages/yusronarif/laravel-rbac)

[![GitHub forks](https://camo.githubusercontent.com/e7a20cff836987f1d3cf4da40b6bfbeaed7aaf4dc99808faf2820957d9241fa6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f797573726f6e617269662f6c61726176656c2d726261633f7374796c653d736f6369616c)](https://github.com/yusronarif/laravel-rbac)[![GitHub stars](https://camo.githubusercontent.com/b788eed218ea9192593c9eee77fb71541b40775f747f65df535e12c4673c7951/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f797573726f6e617269662f6c61726176656c2d726261633f7374796c653d736f6369616c)](https://github.com/yusronarif/laravel-rbac)

This package allows you to manage user permissions and roles in a database.

Once installed you can do stuff like this:

```
// Adding permissions to a user
$user->givePermissionTo('edit articles');

// Adding permissions via a role
$user->assignRole('writer');

$role->givePermissionTo('edit articles');
```

Because all permissions will be registered on [Laravel's gate](https://laravel.com/docs/authorization), you can check if a user has a permission with Laravel's default `can` function:

```
$user->can('edit articles');
```

Documentation, Installation, and Usage Instructions
---------------------------------------------------

[](#documentation-installation-and-usage-instructions)

See the [documentation site](https://docs.spatie.be/laravel-permission/v3/introduction/) for detailed installation and usage instructions.

Need a UI?
----------

[](#need-a-ui)

The package doesn't come with any screens out of the box, you should build that yourself. Here are some options to get you started:

- [Laravel Nova package by @vyuldashev for managing Roles and Permissions](https://github.com/vyuldashev/nova-permission)
- [Laravel Nova package by @paras-malhotra for managing Roles and Permissions and permissions based authorization for Nova Resources](https://github.com/insenseanalytics/laravel-nova-permission)
- [Extensive tutorial for building permissions UI](https://scotch.io/tutorials/user-authorization-in-laravel-54-with-spatie-laravel-permission) by [Caleb Oki](http://www.caleboki.com/).
- [How to create a UI for managing the permissions and roles](http://www.qcode.in/easy-roles-and-permissions-in-laravel-5-4/)
- [Laravel User Management for managing users, roles, permissions, departments and authorization](https://github.com/Mekaeil/LaravelUserManagement) by [Mekaeil](https://github.com/Mekaeil)

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

Postcardware
------------

[](#postcardware)

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium.

We publish all received postcards [on our company website](https://spatie.be/en/opensource/postcards).

Credits
-------

[](#credits)

- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)

This package is heavily based on [Jeffrey Way](https://twitter.com/jeffrey_way)'s awesome [Laracasts](https://laracasts.com) lessons on [permissions and roles](https://laracasts.com/series/whats-new-in-laravel-5-1/episodes/16). His original code can be found [in this repo on GitHub](https://github.com/laracasts/laravel-5-roles-and-permissions-demo).

Special thanks to [Alex Vanderbist](https://github.com/AlexVanderbist) who greatly helped with `v2`, and to [Chris Brown](https://github.com/drbyte) for his longtime support helping us maintain the package.

Alternatives
------------

[](#alternatives)

- [Povilas Korop](https://twitter.com/@povilaskorop) did an excellent job listing the alternatives [in an article on Laravel News](https://laravel-news.com/two-best-roles-permissions-packages). In that same article, he compares laravel-permission to [Joseph Silber](https://github.com/JosephSilber)'s Bouncer, which in our book is also an excellent package.
- [ultraware/roles](https://github.com/ultraware/roles) takes a slightly different approach to its features.
- [santigarcor/laratrust](https://github.com/santigarcor/laratrust) implements team support
- [zizaco/entrust](https://github.com/zizaco/entrust) offers some wildcard pattern matching

Support us
----------

[](#support-us)

Spatie is a web design agency based in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource).

Does your business depend on our contributions? Reach out and support us on [Patreon](https://www.patreon.com/spatie). All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff.

License
-------

[](#license)

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

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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 ~0 days

Total

2

Last Release

2414d ago

Major Versions

v1.0.0 → v2.0.02019-10-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/7a1ab844f9d950664446a882d81438fc5acdb56def71a07bafb0e505ab5f1c92?d=identicon)[yusronarif](/maintainers/yusronarif)

---

Top Contributors

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

---

Tags

laravelsecurityaclpermissionrolespermissionsrbacyusronarifyusronarif

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k89.8M1.0k](/packages/spatie-laravel-permission)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[wnikk/laravel-access-rules

Simple system of ACR (access control rules) for Laravel, with roles, groups, unlimited inheritance and possibility of multiplayer use.

103.6k1](/packages/wnikk-laravel-access-rules)[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)
