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

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

yard8/laravel-permissions
=========================

Creates user roles and the various permissions your application would use for authorisation.

1.0.5(6y ago)012MITPHPPHP ^7.1CI failing

Since Oct 18Pushed 6y ago2 watchersCompare

[ Source](https://github.com/Yard8/laravel-permissions)[ Packagist](https://packagist.org/packages/yard8/laravel-permissions)[ Docs](https://github.com/Yard8/laravel-permissions)[ RSS](/packages/yard8-laravel-permissions/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (7)Used By (0)

Laravel Permissions
===================

[](#laravel-permissions)

[![Latest Version on Packagist](https://camo.githubusercontent.com/30124eb09e0e90d51c03811c81445c74fb325f835ff7118ec3b35dad3d2463fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f79617264382f6c61726176656c2d7065726d697373696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/yard8/laravel-permissions)[![Build Status](https://camo.githubusercontent.com/9cfb65d031c7dda214c35e8a2cc6865f38ccd4c9ee0766c008da032e0661fe09/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f79617264382f6c61726176656c2d7065726d697373696f6e732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/yard8/laravel-permissions)[![Quality Score](https://camo.githubusercontent.com/4b695ba3bcf80a57d12938f24634ef77dc7b0db5d6723dd07683743bcc3ec7ea/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f79617264382f6c61726176656c2d7065726d697373696f6e732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/yard8/laravel-permissions)[![Total Downloads](https://camo.githubusercontent.com/acfd866fb8c00e763e78eeedfed27b673a7efd063fd32c0094ccfdb9ec4435a6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f79617264382f6c61726176656c2d7065726d697373696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/yard8/laravel-permissions)

The purpose of this package is to create both roles and permissions which could be assigned to a user and used during authorisation or policy checks.

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

[](#installation)

You can install the package via composer:

```
composer require yard8/laravel-permissions
```

Publish the config and migration files:

```
php artisan laravel-permissions:install
```

Add on a `role_id` column which is an `unsigned bigInteger` to the users table which will be related to both the roles and permissions:

Setup the config permissions.php to include the roles and permissions you want in your application.

Insert the roles and permissions into your database:

```
php artisan laravel-permissions:insert
```

Add the HasPermissions trait to the model you want to have the roles and permissions:

```
