marko / authorization
Policy-based authorization with Gates and Policies for Marko Framework
Package info
github.com/marko-php/marko-authorization
Type:marko-module
pkg:composer/marko/authorization
0.11.0
2026-10-06 14:15 UTC
Requires
- php: ^8.5
- marko/authentication: 0.11.0
- marko/config: 0.11.0
- marko/core: 0.11.0
- marko/routing: 0.11.0
Requires (Dev)
- marko/authentication-token: 0.11.0
- marko/testing: 0.11.0
- pestphp/pest: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Gates, policies, and the #[Can] attribute -- control who can do what with expressive, testable authorization checks.
Installation
composer require marko/authorization
Quick Example
use Marko\Authorization\Attributes\Can; use Marko\Routing\Attributes\Get; use Marko\Routing\Http\Response; class AdminController { // Enforced on every request once the package is installed: 401 if logged out, 403 if denied #[Get('/admin')] #[Can('admin.access')] public function dashboard(): Response { return new Response('Welcome'); } }
Documentation
Full usage, API reference, and examples: marko/authorization