PHPackages                             lomkit/laravel-access-control - 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. [Security](/categories/security)
4. /
5. lomkit/laravel-access-control

ActiveLibrary[Security](/categories/security)

lomkit/laravel-access-control
=============================

A package to help you manage your laravel application access rights.

v0.4.0(1mo ago)58.6k↓29.5%3[1 PRs](https://github.com/Lomkit/laravel-access-control/pulls)MITPHPPHP ^8.2CI passing

Since Apr 17Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/Lomkit/laravel-access-control)[ Packagist](https://packagist.org/packages/lomkit/laravel-access-control)[ GitHub Sponsors](https://github.com/GautierDele)[ RSS](/packages/lomkit-laravel-access-control/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (13)Used By (0)

[![Social Card of Laravel Access Control](https://raw.githubusercontent.com/Lomkit/art/main/laravel-access-control/cover.png)](https://raw.githubusercontent.com/Lomkit/art/main/laravel-access-control/cover.png)

Laravel Access Control
======================

[](#laravel-access-control)

Laravel Access Control allows you to fully secure your application in two key areas: Policies and Queries. Manage everything in one place!

Requirements
------------

[](#requirements)

PHP 8.2+ and Laravel 11+

Documentation, Installation, and Usage Instructions
---------------------------------------------------

[](#documentation-installation-and-usage-instructions)

See the [documentation](https://laravel-access-control.lomkit.com) for detailed installation and usage instructions.

What it does
------------

[](#what-it-does)

You first need to define the perimeters concerned by your applications.

Create the model control:

```
class PostControl extends Control
{
    protected function perimeters(): array
    {
        return [
            GlobalPerimeter::new()
                ->allowed(function (Model $user, string $method) {
                    return $user->can(sprintf('%s global models', $method));
                })
                ->should(function (Model $user, Model $model) {
                    return true;
                })
                ->query(function (Builder $query, Model $user) {
                    return $query;
                }),
            ClientPerimeter::new()
                ->allowed(function (Model $user, string $method) {
                    return $user->can(sprintf('%s client models', $method));
                })
                ->should(function (Model $user, Model $model) {
                    return $model->client()->is($user->client);
                })
                ->query(function (Builder $query, Model $user) {
                    return $query->where('client_id', $user->client->getKey());
                }),
        // ...
```

Specify the control in your model:

```
class Post extends Model
{
    use HasControl;
}
```

Then set up your policy:

```
class PostPolicy extends ControlledPolicy
{
    protected string $model = Post::class;
}
```

and you are ready to go !

```
App\Models\Post::controlled()->get() // Apply the Control to the query

$user->can('view', App\Models\Post::first()) // Check if the user can view the post according to the policy
```

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance89

Actively maintained with recent releases

Popularity32

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.4% 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 ~31 days

Recently: every ~65 days

Total

12

Last Release

57d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12382966?v=4)[Gautier DELEGLISE](/maintainers/GautierDele)[@GautierDele](https://github.com/GautierDele)

---

Top Contributors

[![GautierDele](https://avatars.githubusercontent.com/u/12382966?v=4)](https://github.com/GautierDele "GautierDele (48 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (10 commits)")[![15g-lucas](https://avatars.githubusercontent.com/u/127982751?v=4)](https://github.com/15g-lucas "15g-lucas (2 commits)")[![coderabbitai[bot]](https://avatars.githubusercontent.com/in/347564?v=4)](https://github.com/coderabbitai[bot] "coderabbitai[bot] (1 commits)")[![Samoht70](https://avatars.githubusercontent.com/u/84769336?v=4)](https://github.com/Samoht70 "Samoht70 (1 commits)")

---

Tags

laravelsecurityaccesscontrollomkit

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lomkit-laravel-access-control/health.svg)

```
[![Health](https://phpackages.com/badges/lomkit-laravel-access-control/health.svg)](https://phpackages.com/packages/lomkit-laravel-access-control)
```

###  Alternatives

[akaunting/laravel-firewall

Web Application Firewall (WAF) package for Laravel

999465.8k2](/packages/akaunting-laravel-firewall)[enlightn/laravel-security-checker

A Laravel package to scan your dependencies for known security vulnerabilities.

51173.4k](/packages/enlightn-laravel-security-checker)[glaivepro/hidevara

Laravel millipackage that hides variables from getting dumped in the Whoops page when your app crashes.

27303.9k](/packages/glaivepro-hidevara)[dasundev/filament-access-secret

Secures access to Filament by requiring a secret key in the URL.

382.4k](/packages/dasundev-filament-access-secret)

PHPackages © 2026

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