Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Laravel
  3. Entrust

Entrust

MITPHP1.7.0

A Laravel package for adding role-based permissions and authorization to Laravel 9|10 applications.

GitHubGitHub
6.0k stars1.3k forks0 contributors

What is Entrust?

Entrust is a Laravel package that adds role-based permissions (RBAC) to Laravel applications. It provides a simple way to define roles and permissions, assign them to users, and check authorization throughout the application. The package solves the problem of managing complex user permissions by offering an intuitive API and seamless integration with Laravel's ecosystem.

Target Audience

Laravel developers building applications that require granular user permissions and role-based access control, such as admin panels, multi-user platforms, or content management systems.

Value Proposition

Developers choose Entrust for its clean, expressive syntax, deep integration with Laravel (including middleware, Blade directives, and Eloquent), and flexibility in handling complex permission scenarios without writing repetitive authorization logic.

Overview

Role-based Permissions for Laravel 5

Use Cases

Best For

  • Adding role-based access control to Laravel admin panels
  • Managing user permissions in multi-tenant applications
  • Protecting routes and controllers based on user roles
  • Conditionally displaying content in Blade templates based on permissions
  • Implementing complex authorization logic with role and permission combinations
  • Extending Laravel's built-in authentication with RBAC features

Not Ideal For

  • Projects relying solely on Laravel's built-in policies and gates for simple, resource-based authorization
  • Teams seeking a package with frequent, active maintenance and modern PHP standards
  • Applications requiring attribute-based access control (ABAC) or dynamic permissions beyond static roles
  • High-scale systems where database performance with many-to-many role/permission relationships is a critical concern

Pros & Cons

Pros

Deep Laravel Integration

Seamlessly integrates with Laravel's ecosystem through Blade directives (@role, @permission), middleware, and Eloquent traits, reducing boilerplate code for authorization logic.

Flexible Permission Checks

Supports advanced features like wildcard permissions (e.g., admin.*), array-based role checks, and the ability() method for complex authorization scenarios with configurable options.

Comprehensive Feature Set

Includes route filtering (Entrust::routeNeedsPermission), soft delete handling, and multiple assignment methods, covering most RBAC needs from basic to advanced use cases.

Expressive API

Provides intuitive methods like hasRole() and can() with clear syntax, making authorization code readable and maintainable, as shown in the README examples.

Cons

Setup Complexity

Requires multiple manual steps: editing config files, creating custom models, running migrations, and handling service providers, which can be error-prone for quick setups.

Maintenance Concerns

As a forked project from an older version, it may lack regular updates and community support compared to more actively maintained alternatives like Spatie's Laravel Permission.

Soft Delete Limitations

The README explicitly warns that soft deleting requires manual cleanup of pivot table data, adding development overhead and risk of data corruption if not handled carefully.

Scaling Performance

Relies on Eloquent many-to-many relationships for roles and permissions, which can lead to N+1 query issues or performance bottlenecks in applications with thousands of users or complex permission sets.

Frequently Asked Questions

Quick Stats

Stars6,011
Forks1,282
Contributors0
Open Issues373
Last commit1 year ago
CreatedSince 2013

Tags

#eloquent#rbac#laravel#authorization#access-control#blade-templates#php#role-based-access-control#permissions#middleware

Built With

B
Blade
E
Eloquent ORM
P
PHP
L
Laravel

Included in

Laravel13.0k
Auto-fetched 1 day ago

Related Projects

LiveWireLiveWire

A full-stack framework for Laravel that takes the pain out of building dynamic UIs.

Stars23,502
Forks1,735
Last commit1 day ago
Debug BarDebug Bar

Debugbar for Laravel (Integrates PHP Debug Bar)

Stars19,179
Forks1,607
Last commit1 day ago
IDE HelperIDE Helper

IDE Helper for Laravel

Stars14,891
Forks1,188
Last commit23 days ago
Intervention ImageIntervention Image

PHP Image Processing

Stars14,330
Forks1,491
Last commit5 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub