PHPackages                             buiphu/aclringier - 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. buiphu/aclringier

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

buiphu/aclringier
=================

This package provides a flexible way to add Role-based Permissions to Laravel

112[2 PRs](https://github.com/buiphu/aclringier/pulls)PHP

Since Sep 17Pushed 10y ago1 watchersCompare

[ Source](https://github.com/buiphu/aclringier)[ Packagist](https://packagist.org/packages/buiphu/aclringier)[ RSS](/packages/buiphu-aclringier/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

testpackage
===========

[](#testpackage)

Ngocphu ACL Ringier
===================

[](#ngocphuacl-ringier)

Installation

In order to install Laravel 5 Entrust, just add

```
"buiphu/aclringier": "dev-master"

```

to your composer.json. Then run `composer install` or `composer update`.

Then in your `config/app.php` add

```
    'Zizaco\Entrust\EntrustServiceProvider'
```

in the `providers` array and

```
    'Entrust' => 'Zizaco\Entrust\EntrustFacade'
```

to the `aliases` array.

Configuration
-------------

[](#configuration)

Set the property values in the `config/auth.php`. These values will be used by entrust to refer to the correct user table and model.

You can also publish the configuration for this package to further customize table names and model namespaces.
Just use `php artisan vendor:publish` and a `entrust.php` file will be created in your app/config directory.

### User relation to roles

[](#user-relation-to-roles)

Now generate the Entrust migration:

```
php artisan entrust:migration
```

It will generate the `_entrust_setup_tables.php` migration. You may now run it with the artisan migrate command:

```
php artisan migrate
```

After the migration, four new tables will be present:

- `roles` — stores role records
- `permissions` — stores permission records
- `role_user` — stores [many-to-many](http://laravel.com/docs/4.2/eloquent#many-to-many) relations between roles and users
- `permission_role` — stores [many-to-many](http://laravel.com/docs/4.2/eloquent#many-to-many) relations between roles and permissions

### Models

[](#models)

#### Role

[](#role)

Create a Role model inside `app/models/Role.php` using the following example:

```
