PHPackages                             ge/lararole - 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. ge/lararole

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

ge/lararole
===========

"User Roles and permissions for the system"

08HTML

Since Jun 28Pushed 7y ago1 watchersCompare

[ Source](https://github.com/syedarifiqbal/lararole)[ Packagist](https://packagist.org/packages/ge/lararole)[ RSS](/packages/ge-lararole/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Lararole
========

[](#lararole)

Lararole is the package to manage user's roles and permissions for your website/blog/website by using this package you will have role and permissions module where you can define as many role as you want along with permissions as well as you can easily customize theme as per your theme requirements.

> **Please Note** this package will assume you are already using laravel authentication system and you have already `users` table in your database

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

[](#installation)

In order to use **Laravel** firstly, pull in the package through Composer

```
composer require ge/lararole

```

you can also add this package in your project's `composer.json` file.

```
"require": {
  "Ge/Lararole": "1.*",
}

```

after adding package in composer.json you will need to update composer

```
composer update

```

And then include the service provider within `app/config/app.php`

```
'providers' => [
    Ge\Lararole\LararoleServiceProvider::class
];

```

If you are in **laravel 5.6** then skip the last step laravel auto discover feature will be add automatically

#### Run Migration

[](#run-migration)

```
php artisan migrate

```

This will generate necessary database tables

###### Make User model Rolable

[](#make-user-model-rolable)

Open User Model and add rolable trait on it.

```
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Ge\Lararole\Ge\Rolable;

class User extends Authenticatable
{
    use Notifiable, Rolable;
}

```

> **You are all set**

Now you can user the package

##### All available Routes

[](#all-available-routes)

URLMethodROUTE NAMECommentsdomain.com/rolesGETroute('roles')show all available rolesdomain.com/rolesPOSTroute('roles.store')Insert new roledomain.com/roles/{role}/showGETroute('roles.show')Show single roledomain.com/roles/{role}/editGETroute('roles.edit')Role edit formdomain.com/roles/{role}/editPUTroute('roles.update')Update given roledomain.com/roles/{role}/deleteGETroute('roles.destroy')Role delete roledomain.com/permissionsGETroute('permissions')show all available permissionsdomain.com/permissionsPOSTroute('permissions.store')Insert new permissiondomain.com/permissions/{permission}/showGETroute('permissions.edit')Show single permissiondomain.com/permissions/{permission}/editGETroute('permissions.edit')Permission edit formdomain.com/permissions/{permission}/editPUTroute('permissions.update')Update given permissiondomain.com/permissions/{permission}/deleteGETroute('permissions.destroy')Role delete permissionTemplate Customization
----------------------

[](#template-customization)

Of-course you want to customize template as per your site theme, you can override the template by publish vendor to your views directory

```
php artisan vendor:publish --provider=Ge\Lararole\LararoleServiceProvider::class --tag=views

```

Useful methods
--------------

[](#useful-methods)

```
// all the roles has assigned to this user

$user = User::find(1);

foreach($user->roles as $role)
{
    echo $role->name . '';
}

// list all the permissions has in role with ID 1

$role = Role::find(1);

foreach($role->permissions as $permission)
{
    echo $permission->name . '';
}

```

**Happy coding...**

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/bccc5ef087437ed000987862675a54177bf2fc2338f96d8c89e119ae099e565d?d=identicon)[syedarifiqbal](/maintainers/syedarifiqbal)

---

Top Contributors

[![syedarifiqbal](https://avatars.githubusercontent.com/u/8073045?v=4)](https://github.com/syedarifiqbal "syedarifiqbal (2 commits)")

### Embed Badge

![Health badge](/badges/ge-lararole/health.svg)

```
[![Health](https://phpackages.com/badges/ge-lararole/health.svg)](https://phpackages.com/packages/ge-lararole)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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