Download the PHP package ordain/delegation without Composer
On this page you can find all versions of the php package ordain/delegation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ordain/delegation
More information about ordain/delegation
Files in ordain/delegation
Package delegation
Short Description Scoped authority delegation for Laravel with native escalation prevention
License MIT
Homepage https://github.com/rickeysxhemz/ordain-delegation
Informations about the package delegation
Permission Delegation for Laravel
Scoped authority delegation for Laravel. Enforce hierarchical permission boundaries where authority flows downward—users delegate subsets of their own grants, never more. Native escalation prevention with spatie/laravel-permission integration.
The Problem
Traditional RBAC answers: "What can this user do?"
This package answers: "What can this user grant to others?"
Without delegation control, a team lead could assign admin roles, create unlimited users, or manage users outside their hierarchy. This package prevents that.
Features
- Hierarchical user management - Users only manage users they created
- Role & permission delegation - Control which roles/permissions users can assign
- User creation quotas - Limit how many users each manager can create
- Native escalation prevention - Cannot grant more than you have
- Root admin bypass - Configurable super-user override
- Comprehensive audit logging - Track all delegation actions
- Domain events - React to delegation changes
- Built-in caching - Optimized for performance
- Multi-guard support - Works with custom authentication guards
- Blade directives & route macros - Convenient view and routing helpers
- Artisan commands - CLI tools for management
- Octane compatible - Ready for high-performance deployments
Requirements
- PHP 8.2+
- Laravel 11.x or 12.x
- spatie/laravel-permission ^6.0
Installation
Install the package via Composer:
Publish and run the migrations:
Publish the configuration file:
Add the trait to your User model:
Quick Start
Check Authorization
Set Delegation Scope
Protect Routes
Blade Directives
Documentation
| Documentation | Description |
|---|---|
| Installation | Detailed installation and setup guide |
| Configuration | All configuration options explained |
| Core Concepts | Understanding hierarchical delegation |
| Basic Usage | Common usage patterns |
| Advanced Usage | Batch operations, validation, caching |
| Middleware | Route protection middleware |
| Blade & Routes | Blade directives and route macros |
| Events | Domain events and listeners |
| Commands | Artisan console commands |
| Customization | Extending the package |
| API Reference | Complete method reference |
| Testing | Testing your implementation |
| Troubleshooting | Common issues and solutions |
Artisan Commands
Testing
With coverage:
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of delegation with dependencies
illuminate/support Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0
illuminate/contracts Version ^11.0|^12.0
illuminate/cache Version ^11.0|^12.0
spatie/laravel-permission Version ^6.0