PHPackages                             ondrejbakan/permissions - 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. ondrejbakan/permissions

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

ondrejbakan/permissions
=======================

Very simple roles and permissions for Laravel 5.

v1.0.0(9y ago)017PHPPHP &gt;=5.5.9

Since Aug 14Pushed 9y ago1 watchersCompare

[ Source](https://github.com/OndrejBakan/Permissions)[ Packagist](https://packagist.org/packages/ondrejbakan/permissions)[ RSS](/packages/ondrejbakan-permissions/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)DependenciesVersions (4)Used By (0)

Requirements
------------

[](#requirements)

---

Every User should have one or more Roles. Role table should include column `name`, which is then used as key in your permissions config.

This package is very, VERY, simple. You don't have to use the Traits included, you can copy&amp;paste methods inside them, or even customize them to fit your own models.

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

[](#installation)

---

Install the package with composer:

```
composer require ondrejbakan/permissions

```

Once the package is downloaded, add the service provider by opening `config/app.php` and making the following changes:

Add a new item to the `providers` array:

```
OndrejBakan\Permissions\PermissionsServiceProvider::class,

```

Add trait to your User model:

```
use OndrejBakan\Permissions\Traits\HasRoles;

class User extends Model
{
    use HasRoles;
}

```

Add trait to your Role Model:

```
use OndrejBakan\Permissions\Traits\HasPermissions;

class Role extends Model
{
    use HasPermissions;
}

```

Publish config with:

```
php artisan vendor:publish

```

Open and edit `ondrejbakan/permissions/config.php` in Laravel's config folder, for example:

```
