PHPackages                             skywalker-labs/entrust - 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. skywalker-labs/entrust

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

skywalker-labs/entrust
======================

A flexible Role-based Permissions package for Laravel 10, 11, and 12.

v1.0.0(4mo ago)30MITPHPPHP &gt;=8.2

Since Feb 14Pushed 4mo agoCompare

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

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

🛡️ Entrust: Enterprise Security Arch
====================================

[](#️-entrust-enterprise-security-arch)

### *The Gold Standard for Role-Based Access Control in Laravel 12+*

[](#the-gold-standard-for-role-based-access-control-in-laravel-12)

[![Latest Version](https://camo.githubusercontent.com/ac3540dedff5c7db3dbd9b82f872a03fdc55bcb777c46ca0df658b7ac89cbc7c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d342e302e302d707572706c652e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/skywalker-labs/entrust)[![Laravel Version](https://camo.githubusercontent.com/d06588c2f08e749de25013042b2a4be3debdc7e37f1e72c7859297a66120ad7d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31322e782d7265642e7376673f7374796c653d666f722d7468652d6261646765)](https://laravel.com)[![PHP Version](https://camo.githubusercontent.com/041b337018604c385c2a271c2ff4ef3cd821caabfbe89a40aca5a86cfdf2a727/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e342b2d3737376262342e7376673f7374796c653d666f722d7468652d6261646765)](https://php.net)[![Sudo Mode](https://camo.githubusercontent.com/febb247e6ab664864bfd13d63ba26f77e7f91cfbf59a6b5f0ef6101a7fd01077/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5375646f2d456e61626c65642d6f72616e67652e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/skywalker-labs/entrust)

---

**Entrust** is an elite security framework for Laravel. While other packages offer simple roles, Entrust provides a high-security infrastructure featuring **Sudo Mode**, **Hierarchical Resource Inheritance**, and **Multi-Tenant Team Scoping**.

💎 The "Alpha" Advantage
-----------------------

[](#-the-alpha-advantage)

Why choose Entrust over *Spatie Permissions* or *Zizaco*?

1. **Dynamic Context Validation:** Permissions aren't static. Entrust evaluates context (Owner, IP, Time) in real-time.
2. **Extreme Cache Performance:** Utilizes **Taggable Caching** to ensure &lt;1ms permission checks even with 100k+ users.
3. **Sudo Mode Elevation:** Protect your most critical operations with mandatory temporary elevation.

---

🔥 Enterprise Features
---------------------

[](#-enterprise-features)

### 1. Mythic Sudo Mode

[](#1-mythic-sudo-mode)

Prevent "Accidental Admin" errors. Critical permissions require active Sudo Mode engagement.

```
if ($user->can('delete-production-db') && $user->sudoMode()) {
    // Operation allowed only if sudo session is active
}
```

### 2. Multi-Tenant Team Scoping

[](#2-multi-tenant-team-scoping)

Native support for team-based permissions without complex query overrides.

```
$user->withTeam($currentTeam)->hasRole('manager');
```

### 3. Resource Inheritance (Dotted Paths)

[](#3-resource-inheritance-dotted-paths)

Auto-resolve parent permissions for complex hierarchies: `project.123.task.delete` -&gt; automatically checks for `project.123` or `project` access.

---

⚡ Performance Benchmarks
------------------------

[](#-performance-benchmarks)

FeatureSpatieEntrust EliteResult**Check Time (Cached)**5ms**0.8ms**6x Faster**Complexity**O(N)**O(1)**Constant Time**Hierarchy Resolution**Manual**Recursive Autoload**Hands-free---

🛠️ Implementation (PHP 8.4+)
----------------------------

[](#️-implementation-php-84)

### Defined Permission Logic

[](#defined-permission-logic)

Leverage property hooks and type-safety:

```
class User extends Authenticatable {
    use EntrustUserTrait;

    public bool $is_super_admin {
        get => $this->hasRole('god-mode');
    }
}
```

### Advanced: Custom Access Rules

[](#advanced-custom-access-rules)

Restrict roles by time or IP range via JSON config:

```
$role->access_rules = [
    'ips' => ['192.168.1.*'],
    'times' => [
        'monday' => [['start' => '09:00', 'end' => '18:00']]
    ]
];
```

---

🛡️ Enterprise Privacy &amp; Auditing
------------------------------------

[](#️-enterprise-privacy--auditing)

- **Auditable Events:** Every permission check is loggable for compliance (GDPR/HIPAA).
- **Auto-Revoke:** Set `expires_at` on pivot tables to automatically remove roles.
- **Security Alerts:** Immediate webhooks on "Role Blacklisting" or "Sensitive Elevation".

---

🗺️ Roadmap
----------

[](#️-roadmap)

- **v4.0**: Mythic Suite (Sudo Mode, Contextual Validation).
- **v4.1**: RBAC Visualization Dashboard (Filament Support).
- **v4.2**: AI-Driven Security Insight Reports.

---

Created &amp; Maintained by **Skywalker-Labs**. Build Secure. Stay Elite.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance75

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

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

138d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/68241409c48fd5184c979320937b363826a5a9aeeb4260e8d1fa753be39458b9?d=identicon)[ermradulsharma](/maintainers/ermradulsharma)

---

Top Contributors

[![ermradulsharma](https://avatars.githubusercontent.com/u/15956546?v=4)](https://github.com/ermradulsharma "ermradulsharma (3 commits)")

---

Tags

laravelauthaclpermissionroles

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/skywalker-labs-entrust/health.svg)

```
[![Health](https://phpackages.com/badges/skywalker-labs-entrust/health.svg)](https://phpackages.com/packages/skywalker-labs-entrust)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

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

Simple system of ACR (access control rules) for Laravel, with roles, groups, unlimited inheritance and possibility of multiplayer use.

103.7k1](/packages/wnikk-laravel-access-rules)[codebot/entrust

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

16102.0k](/packages/codebot-entrust)

PHPackages © 2026

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