konekt / resource
API Resources library to transform entities/models into REST API objects. Inspired by Laravel - usable in any Framework
Installs: 1 552
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: ^7.2|^8.0
- ext-json: *
Requires (Dev)
- phpunit/phpunit: 8 - 10
This package is auto-updated.
Last update: 2024-10-17 09:54:41 UTC
README
API Resources
When building an HTTP based API, you often need a transformation layer that sits between your models and the JSON (or XML, etc) responses that are actually returned to API consumers.
The API resource classes allow you to transform your models into HTTP Responses (JSON, XML, etc).
This project was inspired by the Laravel API Resources concept. The goal is to make this approach available in non-Laravel applications as well.
Installation
using composer: composer require konekt/resource
Documentation
For detailed usage and examples go to the
Resource Documentation or refer to the markdown files in the
docs/
folder of this repo.
For the list of changes read the Changelog.