PHPackages                             eneadm/ladder - 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. eneadm/ladder

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

eneadm/ladder
=============

Feather light permissions for Laravel.

v1.3.2(1mo ago)26125.0k↓48.9%15[1 PRs](https://github.com/eneadm/ladder/pulls)MITPHPPHP ^8.1CI passing

Since Aug 15Pushed 1w ago3 watchersCompare

[ Source](https://github.com/eneadm/ladder)[ Packagist](https://packagist.org/packages/eneadm/ladder)[ RSS](/packages/eneadm-ladder/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (8)Versions (15)Used By (0)

 [ ![Build Status](https://github.com/eneadm/ladder/workflows/tests/badge.svg) ](https://github.com/eneadm/ladder/actions) [ ![Total Downloads](https://camo.githubusercontent.com/e1f9fa6f0b17cb88b8131bf3d822737e4a4c230f85ec5cd99abe5001e9fcbcde/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656e6561646d2f6c6164646572) ](https://packagist.org/packages/eneadm/ladder) [ ![Latest Stable Version](https://camo.githubusercontent.com/a4f25650274eb08cecc41302470c3f3be5d88e70d05eb020d10175a301ba21a5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656e6561646d2f6c6164646572) ](https://packagist.org/packages/eneadm/ladder) [ ![License](https://camo.githubusercontent.com/771285f8fba69edbf9c6875ca13efda0ce23258da394b591a9560d457f82fed9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f656e6561646d2f6c6164646572) ](https://packagist.org/packages/eneadm/ladder)

Ladder 🪜
========

[](#ladder-)

Ladder simplifies role and permission management for your Laravel project by avoiding storing everything in the database. Inspired by [Laravel Jetstream](https://jetstream.laravel.com/features/teams.html#roles-permissions), it offers a static approach, reducing queries and ensuring immutability for easy modifications.

Install
-------

[](#install)

> This package requires Laravel 10 and above.

```
composer require eneadm/ladder
```

Once Ladder is installed, create a new LadderServiceProvider to manage roles and permissions. You can do so effortlessly with this command:

```
php artisan ladder:install
```

Lastly, execute the `migration` command to create a single pivot `user_role` table, assigning roles to users.

```
php artisan migrate
```

Use
---

[](#use)

Before using Ladder add the `HasRoles` trait to your `App\Models\User` model. By doing so this trait will provide the necessary methods to manage roles and permissions.

```
use Ladder\HasRoles;

class User extends Authenticatable
{
    use HasRoles;
}
```

### `HasRoles` trait in detail

[](#hasroles-trait-in-detail)

```
// Access all of user's roles...
$user->roles : Illuminate\Database\Eloquent\Collection

// Determine if the user has the given role...
$user->hasRole($role) : bool

// Access all permissions for a given role belonging to the user...
$user->rolePermissions($role) : array

// Access all permissions belonging to the user...
$user->permissions() : Illuminate\Support\Collection

// Determine if the user role has a given permission...
$user->hasRolePermission($role, $permission) : bool

// Determine if the user has a given permission...
$user->hasPermission($permission) : bool
```

> All method arguments can accept string, array, Collection or Enum if desired. For optimal performance, it is advisable to use array or Collection as arguments when handling multiple entries.

### Roles &amp; Permissions

[](#roles--permissions)

Users can receive roles with permissions defined in `App\Providers\LadderServiceProvider` using `Ladder::role` method. This involves specifying a role's slug, name, permissions, and description. For instance, in a blog app, role definitions could be:

```
Ladder::role('admin', 'Administrator', [
    'post:read',
    'post:create',
    'post:update',
    'post:delete',
])->description('Administrator users can perform any action.');

Ladder::role('editor', 'Editor', [
    'post:read',
    'post:create',
    'post:update',
])->description('Editor users have the ability to read, create, and update posts.');
```

### Assign Roles

[](#assign-roles)

You may assign roles to the user using the `roles` relationship that is provided by the `Ladder\HasRoles` trait:

```
use App\Models\User;

$user = User::find(1);

$user->roles()->updateOrCreate(['role' => 'admin']);
```

### Authorization

[](#authorization)

For request authorization, utilize the `Ladder\HasRoles` trait's hasPermission method to check user's role permissions. Generally, verifying granular permissions is more important than roles. Roles group permissions and are mainly for presentation. Use the `hasPermission` method within authorization policies.

```
/**
 * Determine whether the user can update a post.
 */
public function update(User $user, Post $post): bool
{
    return $user->hasPermission('post:update');
}
```

### Wildcard Permissions

[](#wildcard-permissions)

Ladder supports wildcard permissions for more flexible permission management:

- `*` - Grants access to all permissions
- `*:create` - Grants access to all create permissions (e.g., `post:create`, `user:create`)
- `*:update` - Grants access to all update permissions (e.g., `post:update`, `user:update`)

```
Ladder::role('super-admin', 'Super Administrator', [
    '*', // Full access to everything
])->description('Super Administrator users can perform any action.');

Ladder::role('content-manager', 'Content Manager', [
    '*:create', // Can create any resource
    '*:update', // Can update any resource
    'post:read',
])->description('Content Manager users can create and update any content.');
```

### Viewing Roles and Permissions

[](#viewing-roles-and-permissions)

You can display a visual table of all roles and their permissions using the `ladder:show` command:

```
php artisan ladder:show
```

The command supports different table styles:

```
php artisan ladder:show default
php artisan ladder:show borderless
php artisan ladder:show compact
php artisan ladder:show box
```

This will display a matrix showing which permissions are assigned to each role, with ✔ and ✖ indicators.

License
-------

[](#license)

Ladder is free software distributed under the terms of the [MIT license](https://github.com/eneadm/ladder/blob/main/LICENSE.md).

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance94

Actively maintained with recent releases

Popularity46

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~211 days

Total

12

Last Release

53d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c10832b760af9adc948abdddbcc6e3e6f1a6622c109863608ae0fbd5a49e7d28?d=identicon)[eneadm](/maintainers/eneadm)

---

Top Contributors

[![eneakh](https://avatars.githubusercontent.com/u/162973167?v=4)](https://github.com/eneakh "eneakh (20 commits)")[![eneadm](https://avatars.githubusercontent.com/u/10241950?v=4)](https://github.com/eneadm "eneadm (13 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![chrispage1](https://avatars.githubusercontent.com/u/2487374?v=4)](https://github.com/chrispage1 "chrispage1 (3 commits)")[![ReinisL](https://avatars.githubusercontent.com/u/18574406?v=4)](https://github.com/ReinisL "ReinisL (1 commits)")[![sheadawson](https://avatars.githubusercontent.com/u/1166136?v=4)](https://github.com/sheadawson "sheadawson (1 commits)")

---

Tags

rolespermissions

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/eneadm-ladder/health.svg)

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

###  Alternatives

[santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

2.3k5.8M47](/packages/santigarcor-laratrust)[silvanite/novatoolpermissions

Laravel Nova Permissions (Roles and Permission based Access Control (ACL))

100266.5k2](/packages/silvanite-novatoolpermissions)[hasinhayder/tyro

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

6804.7k6](/packages/hasinhayder-tyro)[smarch/watchtower

Front-end for the Shinboi Auth system of Users / Roles / Permissions in Laravel 5

523.0k](/packages/smarch-watchtower)

PHPackages © 2026

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