Download the PHP package ayd/authorize without Composer
On this page you can find all versions of the php package ayd/authorize. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ayd/authorize
More information about ayd/authorize
Files in ayd/authorize
Package authorize
Short Description A shared authorization package for Hyperf and Laravel applications at AYD Company.
License MIT
Informations about the package authorize
AYD Company Authorize
Shared authorization decision builder for Laravel and Hyperf applications.
The package focuses on API response abilities:
- RBAC abilities in
response.meta.abilities - ABAC/resource abilities in
response.data[*].abilities - A shared decision shape that frontend applications can consume consistently
Installation
For local package development this package expects ayd/api-response-base
to be available through the local path repository configured in composer.json.
Core Usage
This produces:
For page-level RBAC maps:
Model Usage
Laravel API Resource Usage
The Laravel service provider is listed for package discovery and registers
ResourceAbilitiesResolver as an empty singleton. It does not bind
Ayd\ApiResponseBase\Contracts\AbilitiesResolver by default, so existing
API responses will not suddenly emit empty meta.abilities.
Bind your own resolver if you want automatic meta.abilities injection through
ayd/api-response-laravel:
Hyperf Usage
The Hyperf ConfigProvider registers ResourceAbilitiesResolver as a dependency.
Use the core builder in resources, transformers, or services:
To integrate page-level abilities with ayd/api-response-hyperf, bind an
implementation of Ayd\ApiResponseBase\Contracts\AbilitiesResolver in
your Hyperf dependency config.
Design Notes
- Backends should return decisions, not frontend policy logic.
- Use
meta.abilitiesfor page-level RBAC. - Use
data[*].abilitiesfor row/resource-level ABAC. - Explicit field decisions override the
*fallback. - The frontend should treat these decisions as UX hints only; backend policies remain the source of truth.