PHPackages                             timo-de-winter/filament-authorization - 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. timo-de-winter/filament-authorization

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

timo-de-winter/filament-authorization
=====================================

Easy authorization system for filament, with advanced features to inject permissions from different places.

v5.2.2(2d ago)02.5k↑1168.8%[2 PRs](https://github.com/timo-de-winter/filament-authorization/pulls)MITPHPPHP ^8.3CI passing

Since Sep 11Pushed yesterdayCompare

[ Source](https://github.com/timo-de-winter/filament-authorization)[ Packagist](https://packagist.org/packages/timo-de-winter/filament-authorization)[ Docs](https://github.com/timo-de-winter/filament-authorization)[ GitHub Sponsors](https://github.com/timo-de-winter)[ RSS](/packages/timo-de-winter-filament-authorization/feed)WikiDiscussions v3.x Synced today

READMEChangelog (10)Dependencies (54)Versions (37)Used By (0)

Filament Authorization
======================

[](#filament-authorization)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fce505152870142dc6f1779c779b4f0f6f568289c3cb1d1e4bd36ac44282c4d7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74696d6f2d64652d77696e7465722f66696c616d656e742d617574686f72697a6174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/timo-de-winter/filament-authorization)[![GitHub Tests Action Status](https://camo.githubusercontent.com/b6175389846490c622e09d34aee12fe449d2a1749f102c9012f6304900e335ec/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f74696d6f2d64652d77696e7465722f66696c616d656e742d617574686f72697a6174696f6e2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/timo-de-winter/filament-authorization/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/94972b390305c26c99d3b4f97508c5d930eac41f7d21a1530e9cef9e06275109/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f74696d6f2d64652d77696e7465722f66696c616d656e742d617574686f72697a6174696f6e2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/timo-de-winter/filament-authorization/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/576dc750781d6ea2d86464482a8bc5bc8014b72567c2a53ab4bc465b6bd7db80/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74696d6f2d64652d77696e7465722f66696c616d656e742d617574686f72697a6174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/timo-de-winter/filament-authorization)

Easy authorization system for filament, with advanced features to inject permissions from different places.

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

[](#installation)

You can install the package via composer:

```
composer require timo-de-winter/filament-authorization
```

### Migrations

[](#migrations)

This package makes use of `spatie/laravel-permission`, so if you have not done so already, publish the migrations for this plugin:

```
php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
```

### Prepare your model

[](#prepare-your-model)

Follow [these](https://spatie.be/docs/laravel-permission/v6/prerequisites) instructions to prepare your model to work with roles.

### Configuration

[](#configuration)

You can optionally publish the config file with:

```
php artisan vendor:publish --tag="filament-authorization-config"
```

This is the contents of the published config file:

```
return [
    'guard' => [
        'modifiable' => false,
        'default' => 'web',
    ],
];
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="filament-authorization-views"
```

Usage
-----

[](#usage)

```
$panel
    ->plugin(
        \TimoDeWinter\FilamentAuthorization\FilamentAuthorizationPlugin::make(),
    );
```

### Configurable Resource

[](#configurable-resource)

The RoleResource supports Filament's [configurable resources](https://filamentphp.com/docs/5.x/plugins/configurable-resources-and-pages) feature. You can pass custom configurations to the plugin:

```
use TimoDeWinter\FilamentAuthorization\Filament\Resources\Roles\RoleResource;

$panel
    ->plugin(
        \TimoDeWinter\FilamentAuthorization\FilamentAuthorizationPlugin::make()
            ->roleResource([
                RoleResource::make('custom')->slug('custom-roles'),
            ]),
    );
```

### Providing/injecting permissions

[](#providinginjecting-permissions)

The philosophy of this package is that permissions are defined by your application and not by the permissions as stated in your database. This is useful when you're working with a package-first strategy. My problem was that I want my packages to work independently from each other, but most of the time a lot of them are combined to create a bigger product. Within those applications I want a single resource for role management that allows for any permissions provided by any of the packages to be attached. Since the packages work standalone and can also choose to disable their permission system it is important that there was one modular approach to inject permissions from any of the packages.

Injecting permissions is very easy and can be done in any service provider. The structure is as follows:

- Tabs (optional)
- Prefix
- Permission

Tabs are used to group permissions together in a tab in the resource to give more clarity to the user. You might have a tab named "Default" and one named "Advanced". If there is only 1 tab in total, we do not show tabs at all. Prefixes are mainly used to group permissions together under a given prefix to prevent overlap. And then of course there are permissions.

```
// This is the most simple way to do it
\TimoDeWinter\FilamentAuthorization\Facades\FilamentAuthorization::registerPermission(
    permission: [
        'view' => __('filament-authorization::labels.view'),
        'update' => __('filament-authorization::labels.update'),
        'create' => __('filament-authorization::labels.create'),
        'delete' => __('filament-authorization::labels.delete'),
    ],
    prefix: 'roles',
    prefixTranslation: __('filament-authorization::labels.roles'),
    tab: 'Authorization', // Optional (defaults to "Default")
);
```

### Synchronisation command

[](#synchronisation-command)

The package comes with a command to synchronize all permissions to the database. In most use cases it would be smart to add this command to your deployment script:

```
php artisan authorization:sync-permissions
```

### Admin role and user command

[](#admin-role-and-user-command)

The package comes with a command to easily create an admin role and assign it to a user from the console.

```
php artisan authorization:create-admin-role
```

Testing
-------

[](#testing)

```
composer test
```

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

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Timo de Winter](https://github.com/timo-de-winter)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance100

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 80.5% 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 ~10 days

Recently: every ~2 days

Total

29

Last Release

2d ago

Major Versions

v1.x-dev → v2.0.02025-10-23

v2.x-dev → v3.0.02026-04-05

v3.x-dev → v5.0.02026-06-24

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/77292763?v=4)[timodw-nl](/maintainers/timodw-nl)[@timodw-nl](https://github.com/timodw-nl)

---

Top Contributors

[![timo-de-winter](https://avatars.githubusercontent.com/u/52080998?v=4)](https://github.com/timo-de-winter "timo-de-winter (33 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

laravelTimoDeWinterfilament-authorization

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/timo-de-winter-filament-authorization/health.svg)

```
[![Health](https://phpackages.com/badges/timo-de-winter-filament-authorization/health.svg)](https://phpackages.com/packages/timo-de-winter-filament-authorization)
```

###  Alternatives

[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k39](/packages/spatie-laravel-passkeys)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17760.2k3](/packages/stephenjude-filament-jetstream)[stephenjude/filament-debugger

About

104162.2k2](/packages/stephenjude-filament-debugger)[croustibat/filament-jobs-monitor

Background Jobs monitoring like Horizon for all drivers for FilamentPHP

274326.6k8](/packages/croustibat-filament-jobs-monitor)

PHPackages © 2026

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