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

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

coringawc/filament-acl
======================

Contextual permissions for Filament resources, relation managers, and actions.

v1.1.4(1mo ago)0179[2 PRs](https://github.com/CoringaWc/filament-acl/pulls)1MITPHPPHP ^8.3CI passing

Since Apr 8Pushed 1mo agoCompare

[ Source](https://github.com/CoringaWc/filament-acl)[ Packagist](https://packagist.org/packages/coringawc/filament-acl)[ Docs](https://github.com/coringawc/filament-acl)[ GitHub Sponsors](https://github.com/CoringaWc)[ RSS](/packages/coringawc-filament-acl/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (11)Versions (13)Used By (1)

Filament ACL
============

[](#filament-acl)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c4db629b59f9b36922c5a1e9d733f7a7c65ebdb71381fb980edcdeeba0aa70f2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f72696e676177632f66696c616d656e742d61636c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/coringawc/filament-acl)[![GitHub Tests Action Status](https://camo.githubusercontent.com/d11a26551941eb0d9917a7cbc91775c03df4b815bd6af4c4a5f6ceaf891a9868/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f72696e676177632f66696c616d656e742d61636c2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/coringawc/filament-acl/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/5e9543083050a54e83a491d9778cbb4c7621410cb5429e9372182c37240a1250/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f72696e676177632f66696c616d656e742d61636c2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/coringawc/filament-acl/actions?query=workflow%3A%22Fix+PHP+code+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/677aec6cc94ed8d680d88c92c075221e5b7568690334a37401080e3dcc08c0fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f72696e676177632f66696c616d656e742d61636c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/coringawc/filament-acl)

`coringawc/filament-acl` is a Filament v4 or v5 plugin for permission systems that are driven by `Resource`, `RelationManager`, `Page`, and `Widget` ownership instead of model-derived subjects.

It was designed for complex panels where the same Eloquent model can appear in many different UI contexts and each context may need a different permission namespace.

What It Solves
--------------

[](#what-it-solves)

- Permissions are scoped by Filament owner, not by model class.
- A single model can back many resources without forcing duplicated models or policies.
- Policies can keep using Laravel's native signatures and still receive the Filament permission owner as an extra argument.
- Resources, relation managers, pages, widgets, and custom permissions can all participate in the same permission graph.
- Protected roles such as `super_admin` can be hidden from UI and optionally bypass package-level checks.
- The package ships with an optional built-in roles and permissions resource.

Screenshot
----------

[](#screenshot)

[![Permissions Edit Page](docs/images/permissions-edit.png)](docs/images/permissions-edit.png)

Core Principles
---------------

[](#core-principles)

- Trait-first. No `BaseResource` or `BaseRelationManager` is required.
- Automatic by default. Override methods only when the default subject or ownership is not enough.
- Policy-first. Custom actions continue using Laravel `can()` and Filament `->authorize()`.
- Generic. The package does not depend on `filament-shield`.
- Spatie-compatible. Roles and permissions are stored through `spatie/laravel-permission`.

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

[](#requirements)

- PHP 8.4+
- Laravel 12+
- Filament v4 and v5
- Spatie Laravel Permission

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

[](#installation)

Install the package:

```
composer require coringawc/filament-acl
```

The quickest setup is the install command:

```
php artisan filament-acl:install --panel=admin --migrate --sync --with-admin-user
```

What the install command does:

- publishes `config/permission.php` when it does not already exist
- publishes `config/filament-acl.php`
- publishes the permission migration stub
- detects whether your user model uses `uuid`, `ulid`, `string`, or integer morph keys
- writes that morph-key type into the published package config
- optionally runs migrations
- optionally syncs permissions
- optionally creates or promotes an admin user with the protected role

If config or migration files already exist, the command will not overwrite them silently unless you pass `--force`.

### Manual Publishing

[](#manual-publishing)

If you prefer the manual route:

```
php artisan vendor:publish --tag="permission-config"
php artisan vendor:publish --tag="filament-acl-config"
php artisan vendor:publish --tag="filament-acl-migrations"
php artisan vendor:publish --tag="filament-acl-stubs"
```

Then migrate and sync:

```
php artisan migrate
php artisan filament-acl:sync --panel=admin --with-protected-role
```

Registering The Plugin
----------------------

[](#registering-the-plugin)

Register the plugin once on each panel:

```
