PHPackages                             thinkingmik/acl-manager-laravel - 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. thinkingmik/acl-manager-laravel

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

thinkingmik/acl-manager-laravel
===============================

A Laravel access control list package

2.0.0(11y ago)4151[1 issues](https://github.com/thinkingmik/acl-manager-laravel/issues)MITPHPPHP &gt;=5.4.0

Since Apr 28Pushed 11y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

PHP ACL Manager for Laravel 5
=============================

[](#php-acl-manager-for-laravel-5)

[![Latest Version](https://camo.githubusercontent.com/79ff8704314ac404f95abcd3fca6fcab936ef83890f745208c7ea77458d080d4/687474703a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f7468696e6b696e676d696b2f61636c2d6d616e616765722d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/thinkingmik/acl-manager-laravel)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/54c3e16bbf1b58fa0b1a4dde564945965d41112956a178201784c75b2579d87b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7468696e6b696e676d696b2f61636c2d6d616e616765722d6c61726176656c2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/thinkingmik/acl-manager-laravel)[![Code Quality](https://camo.githubusercontent.com/38310d895505b62428396878660f5359ed2b85b64d5473cf45dad3cb7f97b857/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7468696e6b696e676d696b2f61636c2d6d616e616765722d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/thinkingmik/acl-manager-laravel/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/25c51cfc502482e5ba7fffb74d7202b098136c34b8cdaf0a7eaa1e4942702f4f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7468696e6b696e676d696b2f61636c2d6d616e616765722d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/thinkingmik/acl-manager-laravel)

Versions
--------

[](#versions)

LaravelACL ManagerPHP4.2.x[1.x](https://github.com/thinkingmik/acl-manager-laravel/tree/1.x)&gt;= 5.45.0.x[2.x](https://github.com/thinkingmik/acl-manager-laravel)&gt;= 5.4Summary
-------

[](#summary)

- [Introduction](#introduction)
- [Installation](#installation)
- [Setup](#setup)
- [Migrations and configuration file](#deploy)
    - [Migrations](#migrations)
    - [Configuration](#configuration)
- [Usage](#usage)
    - [Routing](#routing)
    - [Facade](#facade)
- [License](#license)

Introduction
------------

[](#introduction)

Adds ACL to Laravel 5. This ACL solution for Laravel is useful when you need to store policy rules or users' roles into a database. ACL Manager are composed by three entities:

1. Roles
2. Resources
3. Permissions

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

[](#installation)

Add the following line to the `require` section of `composer.json`:

```
{
    "require": {
        "thinkingmik/acl-manager-laravel": "2.x"
    }
}
```

Setup
-----

[](#setup)

1. Add `'ThinKingMik\AclManager\AclManagerServiceProvider',` into the service **provider** list in `config/app.php`.
2. Add `'Acl' => 'ThinKingMik\AclManager\Facades\AclManagerFacade',` into the list of **aliases** in `config/app.php`.
3. Add `'ThinKingMik\AclManager\Middleware\AclManagerExceptionHandler',` into the list of **middlewere** in `app/Http/Kernel.php`.

Migrations and configuration file
-------------------------------------------------------------------

[](#migrations-and-configuration-file)

In order to use the Acl Manager publish its configuration and migrations first

```
php artisan vendor:publish

```

> **Note:** migrations are only published, remember to run them when ready.

### Migrations

[](#migrations)

This package comes with all the migrations you need to run a full featured Acl Manager. First of all you need to check the reference to the user table name:

- Check the users table name of your Laravel installation in `config/auth.php` at the section:

```
/*
 |--------------------------------------------------------------------------
 | Authentication Table
 |--------------------------------------------------------------------------
 |
 | When using the "Database" authentication driver, we need to know which
 | table should be used to retrieve your users. We have chosen a basic
 | default value but you may easily change it to any table you like.
 |
 */

'table' => 'system_users',
```

- Change the table reference for `user_id` foreign key in these files `database/migrations`:

```
xxx_000006_create_acl_users_roles_table.php
xxx_000005_create_acl_users_policies_table.php

```

- Check `user_id` foreign key in all the above files to be sure that the user table name is the same as `'table' => 'system_users'`:

```
$table->foreign('user_id')->references('id')->on('system_users')
```

- Now you can run:

```
php artisan migrate

```

### Configuration

[](#configuration)

Edit the file `config/acl.php` to suit your needs.

Usage
-----

[](#usage)

### Routing

[](#routing)

You can use Acl Manager in routes as a filter

```
Route::get('/private', array('before' => 'auth|acl:admin.*', 'uses' => function() {

}));
```

All checks are made on `user_id` attribute retrieved from session. You can define many different `acl:` filters:

```
acl:role.resource.permission //check if logged user has role and the permission on resource
acl:*.resource.permission    //check if logged user has permission on resource
acl:role.*                   //check if logged user has role
acl:role.resource.*          //check if logged user has role and any permissions on resource
acl:*.resource.*             //check if logged user has any permissions on resource
```

You can also combine these filters with `;` separator like:

```
acl:admin.*;guest.*
```

### Facade

[](#facade)

The Acl Manager is available through the Facade `Acl` or through the acl service in the IOC container. The methods available are:

```
/**
 * Check if user ID has a specified policy/policies
 * @param integer $user User ID
 * @param string $policies The policies used in routing
 * return boolean
 **/
Acl::isRouteAllowed(1, 'admin.*;guest.*');

/**
 * Check if user has permission on resource
 * @param array $users Array of user objects or array of user IDs
 * @param array $resources Array of resource objects or array of resource IDs
 * @param array $permissions Array of permission objects or array of permission IDs
 * return boolean
 **/
Acl::isAllowed(array(1), array('post', 'dashboard'), array('edit', 'view'));

/**
 * Check if role has permission on resource
 * @param array $roles Array of role objects or array of role IDs
 * @param array $resources Array of resource objects or array of resource IDs
 * @param array $permissions Array of permission objects or array of permission IDs
 * return boolean
 **/
Acl::areAnyRolesAllowed(array(1), array('post', 'dashboard'), array('edit', 'view'));

/**
 * Check if user has roles
 * @param array $users Array of user objects or array of user IDs
 * @param array $roles Array of role objects or array of role IDs
 * return boolean
 **/
Acl::hasRole(array(1), array('1', '2'));

/**
 * Add permissions on resources for users specified
 * @param array $users Array of user objects or array of user IDs
 * @param array $resources Array of resource objects or array of resource IDs
 * @param array $permissions Array of permission objects or array of permission IDs
 * @param date [$expire] Optionally you can specify an expiration date for policies
 * return boolean
 **/
Acl::allowUsers(array(1), array('post', 'dashboard'), array('edit', 'view'), '2099-11-01');

/**
 * Add permissions on resources for roles specified
 * @param array $roles Array of role objects or array of role IDs
 * @param array $resources Array of resource objects or array of resource IDs
 * @param array $permissions Array of permission objects or array of permission IDs
 * @param date [$expire] Optionally you can specify an expiration date for policies
 * return boolean
 **/
Acl::allowRoles(array(1), array('post', 'dashboard'), array('edit', 'view'), '2099-11-01');

/**
 * Remove permissions on resources for users specified
 * @param array $users Array of user objects or array of user IDs
 * @param array $resources Array of resource objects or array of resource IDs
 * @param array $permissions Array of permission objects or array of permission IDs
 * return integer The number of deleted policies
 **/
Acl::denyUsers(array(1), array('post', 'dashboard'), array('edit', 'view'));

/**
 * Remove permissions on resources for roles specified
 * @param array $roles Array of role objects or array of role IDs
 * @param array $resources Array of resource objects or array of resource IDs
 * @param array $permissions Array of permission objects or array of permission IDs
 * return integer The number of deleted policies
 **/
Acl::denyRoles(array(1), array('post', 'dashboard'), array('edit', 'view'));

/**
 * Add roles to users
 * @param array $users Array of user objects or array of user IDs
 * @param array $roles Array of role objects or array of role IDs
 * @param char [$main] Optionally you can specify the main role
 * return boolean
 **/
Acl::addUsersRoles(array(1), array('1', '2'), 'Y');
```

License
-------

[](#license)

This package is released under the MIT License.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~5 days

Total

3

Last Release

4027d ago

Major Versions

1.0.0 → 2.0.02015-05-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f0e0b48bdf78b1d116ac39261dded668f0fc2db76e2bff75def5a7fd74c64b2?d=identicon)[mandreoli](/maintainers/mandreoli)

---

Top Contributors

[![thinkingmik](https://avatars.githubusercontent.com/u/2874671?v=4)](https://github.com/thinkingmik "thinkingmik (11 commits)")

---

Tags

laravelaccessaclpermissionresource

### Embed Badge

![Health badge](/badges/thinkingmik-acl-manager-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/thinkingmik-acl-manager-laravel/health.svg)](https://phpackages.com/packages/thinkingmik-acl-manager-laravel)
```

###  Alternatives

[orchestra/auth

Auth Component for Orchestra Platform

24108.5k3](/packages/orchestra-auth)[codebot/entrust

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

1596.6k](/packages/codebot-entrust)

PHPackages © 2026

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