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

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

techlify-inc/laravel-rbac
=========================

Role Based Access Control for Laravel

1.2.2(6y ago)12521MITPHPPHP &gt;=7.1.3CI failing

Since Mar 26Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Techlify-Inc/LaravelRbac)[ Packagist](https://packagist.org/packages/techlify-inc/laravel-rbac)[ RSS](/packages/techlify-inc-laravel-rbac/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (4)Versions (15)Used By (1)

LaravelRbac
===========

[](#laravelrbac)

Just another Role Based Access Control package for Laravel. This one focuses on keeping things simple &amp; sweet.

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

[](#installation)

Install this package with composer using the following command:

```
composer require techlify-inc/laravel-rbac

```

Run migrations

```
$ php artisan migrate

```

Add the Rbac trait to your `User` model

```
class User extends Authenticatable
{
    use TechlifyInc\LaravelRbac\Traits\LaravelRbac;
}
```

Usage
-----

[](#usage)

### Roles

[](#roles)

#### Creating roles

[](#creating-roles)

```
use \TechlifyInc\LaravelRbac\Models\Role;

$adminRole = Role::create([
    'name' => 'Administrator',
    'slug' => 'admin'
]);

$managerRole = Role::create([
    'name' => 'Manager',
    'slug' => 'manager'
]);
```

#### Assigning And Removing Roles

[](#assigning-and-removing-roles)

You can simple attach role to user:

```
use App\User;

$user = User::find(1);
$user->attachRole($adminRole);
//or you can attach using the role slug
$user->attachRole("admin");
```

And the same if you want to detach role:

```
$user->detachRole($adminRole);
//or you can remove using the role slug
$user->detachRole("admin");
```

### Checking for roles

[](#checking-for-roles)

You can simple check if user has role:

```
use App\User;

$user = User::find(1);
if ($user->hasRole('admin')) {

}
```

### Permissions

[](#permissions)

#### Creating permissions

[](#creating-permissions)

```
use \TechlifyInc\LaravelRbac\Models\Permission;

$createPermission = Permission::create([
    'name' => 'Create product',
    'slug' => 'product.create'
]);

$removePermission = Permission::create([
    'name' => 'Delete product',
    'slug' => 'product.remove'
]);
```

#### Attaching And Detaching permissions

[](#attaching-and-detaching-permissions)

You can attach permission to role very simple:

```
use \TechlifyInc\LaravelRbac\Models\Role;

$adminRole = Role::find(1);
$adminRole->attachPermission($createPermission);
//or you can insert only slug
$adminRole->attachPermission("product.create");
```

And the same to detach permission:

```
$adminRole->detachPermission($createPermission);
$adminRole->detachPermission("product.create");
```

### Checking for permissions

[](#checking-for-permissions)

You can simple check if user has permission:

```
use App\User;

$user = User::find(1);
if ($user->hasPermission('product.create')) {

}

// OR for currently logged in user
if (auth()->user()->hasPermission('product.create'))
```

You can also enforce permissions at route level using the middleware (v0.2 onwards):

```
Route::get("customers", "CustomerController@index")->middleware("LaravelRbacEnforcePermission:customer_view");
```

LaravelUserManagement is now merged into this package
=====================================================

[](#laravelusermanagement-is-now-merged-into-this-package)

A simple package for Laravel that provides user management services

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

[](#installation-1)

Install this package with composer using the following command:

```
composer require techlify-inc/laravel-user-management

```

Run migrations

```
$ php artisan migrate

```

Usage
-----

[](#usage-1)

This package provides the following API services that your frontend can use:

### User Management

[](#user-management)

```
// Get the set of users
GET api/users

// Get a single user
GET api/users/{id}

// Add a new user
POST api/users

// Update a user record
PATCH api/users/{id}

// Delete a user record
DELETE api/users/{id}
```

### User Password Management

[](#user-password-management)

```
// Change the current user password
POST api/user/current/update-password {current_password, new_password}
```

### User Session Management

[](#user-session-management)

```
// Log out the currently logged in user
POST api/user/logout

// Get the User record of the currently logged in user
GET api/user/current
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 66.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 ~45 days

Recently: every ~54 days

Total

12

Last Release

2472d ago

Major Versions

0.4.0 → 1.1.02019-01-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/8943a6fc1cc4b35bcea6780b6785b48abc15b246d9806645f9a7ae10466e81b2?d=identicon)[JoshuaKissoon](/maintainers/JoshuaKissoon)

---

Top Contributors

[![techlify](https://avatars.githubusercontent.com/u/37783557?v=4)](https://github.com/techlify "techlify (6 commits)")[![JoshuaKissoon](https://avatars.githubusercontent.com/u/1193750?v=4)](https://github.com/JoshuaKissoon "JoshuaKissoon (3 commits)")

### Embed Badge

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

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

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

9.4k1.8k](/packages/unopim-unopim)[jeremy379/laravel-openid-connect

OpenID Connect support to the PHP League's OAuth2 Server. Compatible with Laravel Passport.

55342.3k2](/packages/jeremy379-laravel-openid-connect)[blair2004/nexopos

The Free Modern Point Of Sale System build with Laravel, TailwindCSS and Vue.js.

1.2k2.3k](/packages/blair2004-nexopos)

PHPackages © 2026

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