PHPackages                             aaronrichards/laravel-roles - 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. aaronrichards/laravel-roles

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

aaronrichards/laravel-roles
===========================

Powerful package for handling roles, permissions, and levels in Laravel. Supports Laravel 5.3 and higher

v3.0.0(6y ago)05MITHTMLPHP &gt;=5.6.4

Since Feb 22Pushed 6y agoCompare

[ Source](https://github.com/aaronrichards/laravel-roles)[ Packagist](https://packagist.org/packages/aaronrichards/laravel-roles)[ RSS](/packages/aaronrichards-laravel-roles/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (6)Versions (16)Used By (0)

### Composer

[](#composer)

From your projects root folder in terminal run:

Laravel 5.8 and up use:

```
    composer require aaronrichards/laravel-roles

```

### Publish All Assets

[](#publish-all-assets)

```
    php artisan vendor:publish --tag=laravelroles
```

### HasRoleAndPermission Trait And Contract

[](#hasroleandpermission-trait-and-contract)

1. Include `HasRoleAndPermission` trait and also implement `HasRoleAndPermission` contract inside your `User` model. See example below.
2. Include `use aaronrichards\LaravelRoles\Traits\HasRoleAndPermission;` in the top of your `User` model below the namespace and implement the `HasRoleAndPermission` trait. See example below.

Example `User` model Trait And Contract:

```
