PHPackages                             pollob666/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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. pollob666/acl

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

pollob666/acl
=============

Dynamically configurable access control management for laravel applications

1.0.3(1y ago)029MITPHPPHP &gt;=7.2.0

Since May 23Pushed 1y agoCompare

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

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

acl
===

[](#acl)

Dynamically configurable access control for Laravel applications..

### install

[](#install)

```
composer require Pollob666/acl

```

### configure

[](#configure)

In your laravel config/app.php under providers add

```
Pollob666\Acl\AclServiceProvider::class
```

### publish

[](#publish)

```
php artisan vendor:publish

```

This command will publish view files inside `views/vendor/acl`, seed files inside the `databases/seed` and a config file `config/acl.php`.

### seed

[](#seed)

At your `DatabaseSeeder.php` under `database/seeds` add the following lines

```
$this->call(UserTableSeeder::class); //optional
$this->call(RoleTableSeeder::class);
$this->call(ResourceTableSeeder::class);
$this->call(PermissionTableSeeder::class);
$this->call(UserRoleTableSeeder::class);
```

NOTE: If you see any kind of class not found type error try running `composer dump-autoload`

### artisan

[](#artisan)

This library comes with an artisan command `acl:resource` to automatically create all the resources (*controller@action*) available in your project under `app/Http/Controllers` directory. To activate this command you need to add these following lines to your `app/Console/Kernel.php` file.

```
protected $commands = [
    \Pollob666\Acl\Commands\AclResource::class
];
```

### @annotation

[](#annotation)

Acl library now has two annotation support `@resource`, and `@allowRole` to be used with controller action

```
/**
* @resource('able to see home')
* @allowRole('Default, Admin')
*/
public function index()
{
    return view('home');
}
```

NOTE: by default **developer** role has the highest permission level, and it doesn't need to be mentioned in the `@allowRole` annotation. If you remove the `@allowRole` annotation it won't delete the permissions from the database, but if you change the role list in the annotation then it will update the databased accordingly.

### middleware

[](#middleware)

This ACL library comes with two middleware as shown below. `AuthenticateWithAcl` is the middleware you need. The other `ResourceMaker` middle ware is just a helper to create resource dynamically if it doesn't exists in the first place and assign permission for it to the `developer` role.

In your `kernal.php` file add this lines

```
'auth.acl' => \Pollob666\Acl\Middleware\AuthenticateWithAcl::class,
'resource.maker' => \Pollob666\Acl\Middleware\ResourceMaker::class,
```

In your `route/web.php` file add this lines

```
Route::group(['middleware' => ['resource.maker','auth.acl']], function () {
    Route::get('/home', 'HomeController@index');
});
```

*IMPORTANT*: `resource.maker` must have to be placed before `auth.acl`. In production you can remove `resource.maker` once you have all the resource generated.

### Role &amp; Resource UI

[](#role--resource-ui)

To access role visit `YOUR-HOST/role` url

To access resource UI visit `YOUR-HOST/resource` url

### helpers

[](#helpers)

`has_access` checks for if a role has access to a specific controller action.

```
@if(has_access('User\UserController@getIndex'))
OR
@if(has_access('UserController@getIndex'))
```

`has_group_access` checks for if a role has access to a specific controller

```
@if(has_group_access(['User-User','User-Role','User-Resource']))
OR
@if(has_group_access('User-User'))
```

`@nullsafe()` checks for whether any of the object property is null or not in a fluent interface ($obj-&gt;prop-&gt;value), if the chain is broken it will simply return an empty string and prevent showing up `call to a member function of a non-object` exception.

Blade example:

```
{{ @nullsafe($obj->prop->value) }}
```

### Credit(Acknowledgement):

[](#creditacknowledgement)

Thanks to Mahbubul Hasan Uzzal for his "" package. This package is just an improvement of his codebase for laravel 6 applications and some additional features.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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

Total

3

Last Release

550d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/18f41d7c00dd13c0137b503b45f6d20576d71153b2bc1497ba61cc9a94d69825?d=identicon)[pollob666](/maintainers/pollob666)

---

Top Contributors

[![pollob666](https://avatars.githubusercontent.com/u/3469402?v=4)](https://github.com/pollob666 "pollob666 (10 commits)")

---

Tags

laravelacldynamic role and permission

### Embed Badge

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

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

###  Alternatives

[santigarcor/laratrust

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

2.3k5.4M43](/packages/santigarcor-laratrust)[jeremykenedy/laravel-roles

A Powerful package for handling roles and permissions in Laravel. Supports Laravel 5.3 up to 12.

1.0k826.8k7](/packages/jeremykenedy-laravel-roles)[codegreencreative/laravel-samlidp

Make your PHP Laravel application an Identification Provider using SAML 2.0. This package allows you to implement your own Identification Provider (idP) using the SAML 2.0 standard to be used with supporting SAML 2.0 Service Providers (SP).

263763.5k1](/packages/codegreencreative-laravel-samlidp)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6712.1k2](/packages/hasinhayder-tyro)

PHPackages © 2026

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