PHPackages                             monkeyscloud/monkeyslegion-resources - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. monkeyscloud/monkeyslegion-resources

ActiveLibrary[API Development](/categories/api)

monkeyscloud/monkeyslegion-resources
====================================

API Resources &amp; Transformers — PHP 8.4 property hooks, JSON:API, attribute-driven field control, pagination, and OpenAPI schema generation

1.0.0(1mo ago)00MITPHPPHP ^8.4

Since May 27Pushed 1mo agoCompare

[ Source](https://github.com/MonkeysCloud/MonkeysLegion-Resources)[ Packagist](https://packagist.org/packages/monkeyscloud/monkeyslegion-resources)[ RSS](/packages/monkeyscloud-monkeyslegion-resources/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (8)Versions (2)Used By (0)

MonkeysLegion Resources
=======================

[](#monkeyslegion-resources)

**API Resources &amp; Transformers for MonkeysLegion** — PHP 8.4 property hooks, JSON:API spec, attribute-driven field control, pagination, and OpenAPI schema generation.

[![PHP 8.4+](https://camo.githubusercontent.com/80c4564163cef31b2a66baaeb95a5bf4a418bcb5242a5ae707b94c2f4811e742/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e342532422d626c7565)](https://php.net)[![License: MIT](https://camo.githubusercontent.com/5caa455d8debc46fb23abbadb45a733a937f3910a73fc875c2f7820468e1bb54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e)](LICENSE)

Installation
------------

[](#installation)

```
composer require monkeyscloud/monkeyslegion-resources
```

Features
--------

[](#features)

FeatureDescription**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`](https://github.com/MonkeysCloud/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
-----------

[](#quick-start)

### Property-Hook Style (PHP 8.4)

[](#property-hook-style-php-84)

```
