PHPackages                             atrauzzi/authoritaire - 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. atrauzzi/authoritaire

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

atrauzzi/authoritaire
=====================

A simple authorization package for Laravel 4.

1.0(12y ago)283.8k3MITPHPPHP &gt;=5.4.0

Since May 11Pushed 12y ago1 watchersCompare

[ Source](https://github.com/atrauzzi/authoritaire)[ Packagist](https://packagist.org/packages/atrauzzi/authoritaire)[ RSS](/packages/atrauzzi-authoritaire/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

Authorization for Eloquent Models
=================================

[](#authorization-for-eloquent-models)

Authoritaire is an attempt to create a simple, [orthogonal](http://goo.gl/JXLzBm) authorization library. The premise came after seeing many Laravel 4 user libraries that couple too tightly with projects and attempt to do too much.

Authoritaire facilitates role-based and permissions-per-role authorization checks. Many systems can get by using only roles, however if you need more fine-grained control over things, permissions are available.

Usage
-----

[](#usage)

Using Authoritaire is as simple as running the migration:

```
./artisan migrate --package="atrauzzi/authoritaire"

```

Implement the [interface](http://goo.gl/tc4e6) `Authorizable` and then add the [trait](http://goo.gl/Z62lC) `AuthorizableImpl` to any model you wish to perform permission checks on.

```
use Atrauzzi\Authoritaire\Model\Authorizable;
use Atrauzzi\Authoritaire\Model\AuthorizableImpl;

class User implements UserInterface, RemindableInterface, Authorizable {
  use AuthorizableImpl;

  // ...

```

You can create new `Permissions` by instantiating them and relating them to a `Role`.

```
$eatPlants = Atrauzzi\Authoritaire\Model\Permission::create([
  'name' => 'Eat Plants'
]);

$vegetarian = Atrauzzi\Authoritaire\Model\Role::create([
  'name' => 'Vegetarian',
  'description' => 'Does not eat meat.'
]);
$vegetarian->permissions()->save($eatPlants);

```

You can grant authorizables membership to `Roles` from either side using `addRole()` from `Authorizable` or `addAuthorizable()` from `Role`:

```
$a = User::first();
$r = Atrauzzi\Authoritaire\Model\Role::where('name', '=', 'Vegetarian')->first();

// Add from authorizable-side.
$a->addRole($r);
// Or add from role-side.
$r->addAuthorizable($a);

```

Performing checks is as simple as asking the user if they are either a member of a role or have access to a permission. Authoritaire will take care of everything.

```
$u->is('Vegetarian');                       // true
$u->can('Eat Plants');                      // true
$u->is('Administrator');                    // false

// You can also perform checks for a set of permissions or roles.
$u->is(['Administrator', 'Vegetarian']);    // false

```

### Currently

[](#currently)

This version of Authoritaire makes use of some workarounds due to [limitations in Laravel 4's polymorphic relations](https://github.com/laravel/framework/issues/1922). As such, one join table has to be more directly manipulated than I would have liked.

License
-------

[](#license)

The Laravel framework is open-sourced software license under the [MIT license](http://goo.gl/tuwnQ)

This project is too to ensure maximum compatibility.

Meta
----

[](#meta)

I'm interested in hearing feedback and suggestions about this package. Please feel free to submit a ticket at any time.

Visit authoritaire:

- ...[on packagist](https://packagist.org/packages/atrauzzi/authoritaire)
- ...[at Sensio Labs Connect](https://connect.sensiolabs.com/profile/omega/project/atrauzzi-authoritaire)

Authoritaire is made by [Alexander Trauzzi](http://goo.gl/QabWv)

A big thank you to [Todd Francis](http://goo.gl/x3MAuE) for his original work on [Verify-L4](http://goo.gl/NlDoFl)! While I didn't keep the lion's share of his work, it has mostly inspired the schema.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60.2% 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

Unknown

Total

1

Last Release

4515d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/115199?v=4)[Alexander Trauzzi](/maintainers/atrauzzi)[@atrauzzi](https://github.com/atrauzzi)

---

Top Contributors

[![Toddish](https://avatars.githubusercontent.com/u/361040?v=4)](https://github.com/Toddish "Toddish (59 commits)")[![atrauzzi](https://avatars.githubusercontent.com/u/115199?v=4)](https://github.com/atrauzzi "atrauzzi (36 commits)")[![arenowebdev](https://avatars.githubusercontent.com/u/996970?v=4)](https://github.com/arenowebdev "arenowebdev (2 commits)")[![wurin7i](https://avatars.githubusercontent.com/u/478210?v=4)](https://github.com/wurin7i "wurin7i (1 commits)")

---

Tags

laravelverifytraitauthorizationrolespermissionspolymorphic

### Embed Badge

![Health badge](/badges/atrauzzi-authoritaire/health.svg)

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

###  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

6783.6k5](/packages/hasinhayder-tyro)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[amdadulhaq/guard-laravel

Guard is Role and Permission management system for Laravel

135.5k](/packages/amdadulhaq-guard-laravel)[shanmuga/laravel-entrust

This package provides a flexible solution to add ACL to Laravel

69329.8k2](/packages/shanmuga-laravel-entrust)

PHPackages © 2026

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