enadstack / laravel-roles
Reusable Roles & Permissions (single or multi-tenant teams) on spatie/laravel-permission
Installs: 57
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/enadstack/laravel-roles
Requires
- php: >=8.2
- illuminate/support: ^12.0
- spatie/laravel-permission: ^6.0
Requires (Dev)
- orchestra/testbench: ^10.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpunit/phpunit: ^11.5
Suggests
- inertiajs/inertia-laravel: Required for Vue UI integration
- stancl/tenancy: Needed only when using multi-database tenancy mode
README
A reusable, multi-tenant, guard-aware ACL system for Laravel applications built on top of spatie/laravel-permission.
Features
- Contract-based architecture with dependency injection
- Three tenancy modes: single, team-scoped, multi-database
- Guard-aware role and permission management
- Contextual caching (tenant, guard, locale aware)
- Permission matrix with efficient queries (no N+1)
- Diff-based permission sync with wildcard support
- Optional Vue UI (Inertia.js + shadcn-vue)
- Comprehensive artisan commands
- Full i18n support for labels and descriptions
Requirements
- PHP 8.2+
- Laravel 12.0+
- spatie/laravel-permission 6.0+
Supported Tenancy Modes
| Mode | Description |
|---|---|
single |
Non-multi-tenant applications |
team_scoped |
Spatie's built-in team feature |
multi_database |
External providers (stancl/tenancy, etc.) |
Installation
composer require enadstack/laravel-roles php artisan roles:install php artisan roles:sync
Documentation
- Installation
- Configuration
- Tenancy
- Guards
- Roles
- Permissions
- Permission Matrix
- Vue UI
- API Reference
- Caching
- Commands
- Testing
- Upgrading
- Troubleshooting
- Feature Roadmap
Changelog
See CHANGELOG.md for release history.
License
MIT License. See LICENSE for details.
Credits
- Enad Abuzaid
- Built on spatie/laravel-permission