PHPackages                             aldozumaran/acl - 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. aldozumaran/acl

ActiveLibrary

aldozumaran/acl
===============

 Laravel 5.2 ACL

v1.1.3(9y ago)21431PHP

Since Mar 30Pushed 9y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (6)Used By (0)

Acl
===

[](#acl)

Laravel 5.2 Acl

Installation
============

[](#installation)

Add to composer.json

```
"aldozumaran/acl": "1.*"

```

Run "composer update"

Add to config/app.php providers

```
AldoZumaran\Acl\AclServiceProvider::class,

```

Add to config/app.php aliases

```
'Acl' => AldoZumaran\Acl\Facades\Acl::class,

```

Add Middleware in kernel.php

```
'acl' => \AldoZumaran\Acl\Http\Middleware\AclMiddleware::class,

```

In User model add this Trait

```
use AldoZumaran\Acl\Traits\AclUserTrait;
class User extends Authenticatable
{

    use AclUserTrait;

```

Publish views, Model...

```
php artisan vendor:publish

```

Change .env file

```
CACHE_DRIVER=array

```

And create acl tables:

```
/*
    //Optional: use seed (AclTableSeeder)
    // Create default permissions (read, update, create, destroy),
    // Create super-admin role
    // Create test route
    // Create default user
    // Add permissions to default user for test route

```

Add in database/seeds/DatabaseSeeder.php

```
    $this->call(AclTableSeeder::class);

```

Add in database/factories/ModelFactory.php

```
    $factory->define(App\Models\Acl\Role::class, function (Faker\Generator $faker) {
        return [
            'code' => $faker->word,
            'name' => $faker->name,
            'description' => $faker->paragraph,
        ];
    });
    $factory->define(App\Models\Acl\Permission::class, function (Faker\Generator $faker) {
        return [
            'code' => $faker->word,
            'name' => $faker->name,
            'description' => $faker->paragraph,
        ];
    });
    $factory->define(App\Models\Acl\Section::class, function (Faker\Generator $faker) {
        return [
            'code' => $faker->word,
            'name' => $faker->name,
            'description' => $faker->paragraph,
        ];
    });
    $factory->define(App\Models\Acl\PermissionRoleSection::class, function (Faker\Generator $faker) {
        return [
            'permission_id' => 1,
            'role_id' => 1,
            'section_id' => 1,
        ];
    });
    $factory->define(App\Models\Acl\PermissionSectionUser::class, function (Faker\Generator $faker) {
        return [
            'permission_id' => 1,
            'section_id' => 1,
            'user_id' => 1,
        ];
    });
*/

```

composer dump-autoload

php artisan migrate --seed

Add ACL routes and test route

```
Route::group(['middleware' => ['web']], function () {
    \Acl::routes();

    Route::group(['middleware' => ['auth','acl']], function () {
        Route::resource('test/custom','CustomController'); // TEST ROUTE
    });
});

```

Default Configuration in config/acl.php

```
//Set your named routes permissions (route actions), defaults are:
'permissions' => [
    'index' => 'read',
    'create' => 'create',
    'store' => 'create',
    'show' => 'read',
    'edit' => 'update',
    'update' => 'update',
    'destroy' => 'destroy',
    'read_update' => ['read','update'],
],

//If permission not exists, redirect to index
'redirect_to_index' => true,

// L5.2 Guard auth
'guard' => 'web',

//Set the auth model namespace
'user' => '\App\User',

//route acl prefix . EX. admin/ set admin
'route_prefix' => '',

// acl urls
'routes' => [
    'roles' => 'acl/roles',
    'users' => 'acl/users',
    'sections' => 'acl/sections',
    'permissions' => 'acl/permissions',
    'index' => 'acl',
],

// roles with access to acl
'granted_roles' => '', // 'admin' or 'admin,webmaster' or ['admin','webmaster']

// super admin role
'role_admin' => 'super-admin',
'email_admin' => 'i@am.me',

// http status error
'http_status' => 403,

```

Usage
=====

[](#usage)

Go to **/acl/** (Default configuration)

This plugin works with named routes

Create a **TEST ROUTE** controller

```
php artisan make:controller CustomController --resource

// Route::resource('test/custom','CustomController');

```

generate **test.custom**.index, **test.custom**.create, **test.custom**.store, ...

Add in Section: /acl/sections (prefix resource controller) or (use AclTableSeeder)

```
test.custom

```

Add Permissions in /acl/permissions or (use AclTableSeeder)

```
read, update, create, destroy

```

Add Roles in /acl/roles or (use AclTableSeeder)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity67

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 ~25 days

Total

5

Last Release

3596d ago

### Community

Maintainers

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

---

Top Contributors

[![aldozumaran](https://avatars.githubusercontent.com/u/3183704?v=4)](https://github.com/aldozumaran "aldozumaran (40 commits)")

### Embed Badge

![Health badge](/badges/aldozumaran-acl/health.svg)

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

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)

PHPackages © 2026

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