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.0.1
2026-03-25 17:53 UTC
Requires
- php: ^8.5
- marko/authentication: 0.0.1
- marko/config: 0.0.1
- marko/core: 0.0.1
- marko/routing: 0.0.1
Requires (Dev)
- marko/testing: 0.0.1
- pestphp/pest: ^4.0
This package is auto-updated.
Last update: 2026-03-25 21:07:27 UTC
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\Contracts\GateInterface; // Define an ability $gate->define( 'edit-settings', fn (?AuthorizableInterface $user) => $user?->can('admin', true) ?? false, ); // Check it $gate->authorize('edit-settings');
Documentation
Full usage, API reference, and examples: marko/authorization