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

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

mirhamit/acl
============

Access Level Control For Laravel

1.2.2(1y ago)21472MITPHPPHP ^7.2.5|&gt;=8.0

Since Aug 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/MirHamit/acl)[ Packagist](https://packagist.org/packages/mirhamit/acl)[ Docs](https://github.com/MirHamit/acl)[ RSS](/packages/mirhamit-acl/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (2)Versions (24)Used By (0)

MirHamit/ACL
============

[](#mirhamitacl)

[![Latest Version on Packagist](https://camo.githubusercontent.com/38e43fb2bacbf3760cb2b81e01caaebb2d9376a931391f556546a22ac680c166/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76656e646f725f736c75672f7061636b6167655f736c75672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mirhamit/acl)[![Total Downloads](https://camo.githubusercontent.com/b09234c7d6775bd20a4055a6563fa0654aae4e7b24de06da4cd940291a0438b4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f76656e646f725f736c75672f7061636b6167655f736c75672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mirhamit/acl)

---

This package can be used to moderate roles and permissions of users in laravel application

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

[](#installation)

open terminal and cd to your project root folder

install laravel :

```
laravel new laravel-acl-package
cd laravel-acl-package
```

setup your laravel auth [Laravel Docs](https://laravel.com/docs/8.x/authentication)

we use laravel 8 [Starter Pack](https://laravel.com/docs/8.x/starter-kits#laravel-breeze) and breeze in this section

```
composer require laravel/breeze --dev
php artisan breeze:install
npm install && npm run dev
```

Install this package with composer

```
composer require mirhamit/acl
```

You can publish and run the migrations with:

```
php artisan vendor:publish --provider="MirHamit\ACL\ACLServiceProvider" --tag="acl-migrations"
```

And publish language files for customize language

```
php artisan vendor:publish --provider="MirHamit\ACL\ACLServiceProvider" --tag="acl-lang"
```

Or publish both language and migrations

```
php artisan vendor:publish --provider="MirHamit\ACL\ACLServiceProvider"
```

And run the migration

```
php artisan migrate
```

---

Usage
-----

[](#usage)

Add HasPermission to your user model

```
use MirHamit\ACL\HasPermissions;
class User extends Authenticatable
{
    use HasApiTokens, HasFactory, Notifiable, HasPermissions;
...
}
```

Give Permission To User:

```
$user->syncPermissions([1,2,3]); // Permission IDS

```

Give Role To User:

```
$user->syncRoles([1,2,3]); // Roles IDS

```

You can add multiple roles in `roles` table and permissions in `permissions` table and bind permission to role in `permission_role` table

You can use middleware: `test-permission` is a permission bound to `test-role` and bound to logged in user

```
Route::get('test', function () {
    return "salam";
})->middleware('role:test-role, test-permission');
```

Or you can use it for only permission bounded for user

```
Route::get('test', function () {
    return "salam";
})->middleware('permission: test-permission');
```

Or you can use it from Laravel Blade

```
@role('test-role')
// or @role(['test-role', 'test-role2'])
// user has role and can access to this section
@endrole
```

And For Check Permission

```
@permission('test-permission')
// or @permission(['test-permission', 'test-permission2'])
// user has role and can access to this section
@endpermission
```

---

Testing
-------

[](#testing)

```
As Soon As Possible
```

---

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

---

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review and check security vulnerabilities and report them in issues section.

---

Credits
-------

[](#credits)

- [Həmid Musəvi](https://github.com/mirhamit)
- [All Contributors](../../contributors)

---

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

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

Recently: every ~66 days

Total

23

Last Release

695d ago

PHP version history (2 changes)1.0.0PHP ^7.2.5|^8.0

1.1.1PHP ^7.2.5|&gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12007014?v=4)[Hamid Musavi](/maintainers/MirHamit)[@MirHamit](https://github.com/MirHamit)

---

Top Contributors

[![MirHamit](https://avatars.githubusercontent.com/u/12007014?v=4)](https://github.com/MirHamit "MirHamit (43 commits)")

---

Tags

laravelaclaccess control listMirHamit

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k98.0M1.3k](/packages/spatie-laravel-permission)[hasinhayder/tyro

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

6753.6k5](/packages/hasinhayder-tyro)[wnikk/laravel-access-rules

Simple system of ACR (access control rules) for Laravel, with roles, groups, unlimited inheritance and possibility of multiplayer use.

103.7k1](/packages/wnikk-laravel-access-rules)[beatswitch/lock-laravel

A Laravel Driver for Lock.

15429.6k1](/packages/beatswitch-lock-laravel)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2013.2k](/packages/alajusticia-laravel-logins)[erag/laravel-role-permission

A simple and easy-to-install role and permission management package for Laravel, supporting versions 10.x and 11.x

404.2k](/packages/erag-laravel-role-permission)

PHPackages © 2026

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