cline / patrol
Framework-agnostic access control package for Laravel with support for ACL, RBAC, ABAC, and RESTful authorization
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/cline/patrol
Requires
- php: ^8.4.0
- composer/semver: ^3.4.4
- spatie/laravel-model-states: ^2.12.1
- spatie/laravel-package-tools: ^1.92.7
Requires (Dev)
- cline/php-cs-fixer: ^1.0.5
- colinodell/json5: ^3.0
- driftingly/rector-laravel: ^2.1.3
- ergebnis/composer-normalize: ^2.49@dev
- laravel/pint: ^1.25.1
- league/csv: ^9.27.1
- orchestra/testbench: ^10.6
- pestphp/pest: ^4.1.3
- pestphp/pest-plugin-laravel: ^4.0
- pestphp/pest-plugin-type-coverage: ^4.0.3
- phpstan/phpstan: ^2.1.31
- rector/rector: ^2.2.7
- saloonphp/xml-wrangler: ^1.4
- spatie/laravel-permission: ^6.23
- symfony/var-dumper: ^7.3.5
- yosymfony/toml: ^1.0.4
Suggests
- colinodell/json5: Required for JSON5 storage driver (^3.0)
- league/csv: Required for CSV storage driver (^9.0)
- saloonphp/xml-wrangler: Required for XML storage driver (^2.0)
- symfony/yaml: Required for YAML storage driver (^7.0)
- yosymfony/toml: Required for TOML storage driver (^1.0)
README
Flexible authorization for Laravel with support for 11+ access control models. Choose the model that fits your needs - from simple ACL to complex ABAC - or combine multiple models in the same application.
Requirements
Requires PHP 8.2+ Requires Laravel 11.0+
Installation
composer require cline/patrol
Publish the configuration:
php artisan vendor:publish --tag=patrol-config
Documentation
Getting Started
- Quick Start - Get up and running in minutes
- Quick Reference - Choose your model in 2 minutes
- Beginner's Path - ACL → RBAC → ABAC learning path
Authorization Models
- Authorization Models Overview - All 11 models with examples
- ACL Models - Access Control List (basic, superuser, without users, without resources)
- RBAC Models - Role-Based Access Control (basic, resource roles, domains)
- ABAC - Attribute-Based Access Control
- RESTful - HTTP path/method authorization
- Security Patterns - Deny-Override and Priority-Based
Guides
- API Reference - Complete API documentation
- Policy Builders - Fluent APIs for building policies
- CLI Tools - Test and debug from command line
- Configuration - Complete configuration guide
- Persisting Policies - Database, cache, and file storage
Advanced Topics
- Complete Cookbook - Comprehensive guides and patterns
- Delegation - Policy delegation patterns
- Native Delegation - Laravel native authorization
Change log
Please see the Releases for more information on what has changed recently.
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please use the GitHub security reporting form rather than the issue queue.
Credits
License
The MIT License. Please see License File for more information.