承接 skywalker-labs/entrust 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

skywalker-labs/entrust

最新稳定版本:v1.0.0

Composer 安装命令:

composer require skywalker-labs/entrust

包简介

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

README 文档

README

🛡️ Entrust: Enterprise Security Arch

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

Latest Version Laravel Version PHP Version Sudo Mode

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

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 <1ms permission checks even with 100k+ users.
  3. Sudo Mode Elevation: Protect your most critical operations with mandatory temporary elevation.

🔥 Enterprise Features

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

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

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

3. Resource Inheritance (Dotted Paths)

Auto-resolve parent permissions for complex hierarchies: project.123.task.delete -> automatically checks for project.123 or project access.

⚡ Performance Benchmarks

Feature Spatie Entrust Elite Result
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+)

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

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

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

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

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固