Download the PHP package monkeyscloud/monkeyslegion-resources without Composer
On this page you can find all versions of the php package monkeyscloud/monkeyslegion-resources. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download monkeyscloud/monkeyslegion-resources
More information about monkeyscloud/monkeyslegion-resources
Files in monkeyscloud/monkeyslegion-resources
Download monkeyscloud/monkeyslegion-resources
More information about monkeyscloud/monkeyslegion-resources
Files in monkeyscloud/monkeyslegion-resources
Vendor monkeyscloud
Package monkeyslegion-resources
Short Description API Resources & Transformers — PHP 8.4 property hooks, JSON:API, attribute-driven field control, pagination, and OpenAPI schema generation
License MIT
Package monkeyslegion-resources
Short Description API Resources & Transformers — PHP 8.4 property hooks, JSON:API, attribute-driven field control, pagination, and OpenAPI schema generation
License MIT
Please rate this library. Is it a good library?
Informations about the package monkeyslegion-resources
MonkeysLegion Resources
API Resources & Transformers for MonkeysLegion — PHP 8.4 property hooks, JSON:API spec, attribute-driven field control, pagination, and OpenAPI schema generation.
Installation
Features
| Feature | Description |
|---|---|
| Dual-mode resources | PHP 8.4 property hooks and classic method-based |
| JSON:API compliance | Full {type, id, attributes, relationships, links, meta} envelope |
| Attribute-driven | #[Expose], #[Hidden], #[Groups], #[Computed], #[When], #[WhenLoaded] |
| Sparse fieldsets | ?fields[users]=name,email |
| Includes | ?include=roles,orders |
| Pagination | Integrates with monkeyslegion-pagination + offset/cursor/simple |
| OpenAPI generation | #[ApiField] → OpenAPI 3.1 schemas via monkeyslegion-openapi |
| Serializer bridge | Optional delegation to monkeyslegion-serializer |
| CLI generator | php ml make:resource UserResource --json-api |
Quick Start
Property-Hook Style (PHP 8.4)
Method-Based Style (Classic)
JSON:API Resource
Controller Usage
OpenAPI Schema Generation
Serializer Bridge
CLI Generator
Attributes Reference
| Attribute | Target | Description |
|---|---|---|
#[Expose(name?)] |
Property | Include field in output, optionally rename |
#[Hidden] |
Property | Exclude field from output |
#[Groups(['...'])] |
Property / Class | Serialization groups |
#[Computed] |
Property | Virtual field (no backing entity prop) |
#[When(condition)] |
Property | Include only if method returns true |
#[WhenLoaded(relation)] |
Property | Include only if relation is loaded on entity |
#[ApiField(...)] |
Property | OpenAPI type, format, description, example |
Collection Interface
Both ResourceCollection and JsonApiCollection implement ResourceCollectionInterface:
Dependencies
| Package | Required | Purpose |
|---|---|---|
monkeyscloud/monkeyslegion-http |
✅ | PSR-7 JsonResponse |
monkeyscloud/monkeyslegion-di |
✅ | Dependency injection |
monkeyscloud/monkeyslegion-pagination |
✅ | Pagination integration |
monkeyscloud/monkeyslegion-openapi |
✅ | OpenAPI schema generation |
monkeyscloud/monkeyslegion-serializer |
💡 Suggested | Advanced normalization via SerializerBridge |
monkeyscloud/monkeyslegion-cli |
💡 Suggested | make:resource CLI command |
License
MIT © MonkeysCloud Team
All versions of monkeyslegion-resources with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.4
monkeyscloud/monkeyslegion-cli Version ^2.0
monkeyscloud/monkeyslegion-di Version ^2.0
monkeyscloud/monkeyslegion-http Version ^2.1
monkeyscloud/monkeyslegion-openapi Version ^1.0
monkeyscloud/monkeyslegion-pagination Version ^1.0
monkeyscloud/monkeyslegion-serializer Version ^1.0
monkeyscloud/monkeyslegion-cli Version ^2.0
monkeyscloud/monkeyslegion-di Version ^2.0
monkeyscloud/monkeyslegion-http Version ^2.1
monkeyscloud/monkeyslegion-openapi Version ^1.0
monkeyscloud/monkeyslegion-pagination Version ^1.0
monkeyscloud/monkeyslegion-serializer Version ^1.0
The package monkeyscloud/monkeyslegion-resources contains the following files
Loading the files please wait ...