Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/insolita/yii2-fractal
A set of utils and actions for build API following JSON:Api specification, based on league/fractal
https://github.com/insolita/yii2-fractal
hacktoberfest json-api rest-api yii2-extension
Last synced: 3 months ago
JSON representation
A set of utils and actions for build API following JSON:Api specification, based on league/fractal
- Host: GitHub
- URL: https://github.com/insolita/yii2-fractal
- Owner: Insolita
- License: mit
- Created: 2020-09-15T17:14:56.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-12-25T01:12:52.000Z (about 3 years ago)
- Last Synced: 2024-10-10T22:03:45.067Z (3 months ago)
- Topics: hacktoberfest, json-api, rest-api, yii2-extension
- Language: PHP
- Homepage:
- Size: 183 KB
- Stars: 5
- Watchers: 2
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# yii2-fractal Beta
![yii2-fractal](https://github.com/Insolita/yii2-fractal/workflows/yii2-fractal/badge.svg)
The set of utils and actions for prepare Rest API accordingly JSON:Api https://jsonapi.org/format/
With https://fractal.thephpleague.com### Installation
`composer require insolita/yii2-fractal`
### Usage
1. Add class `insolita\fractal\JsonApiBootstrap` to the ['bootstrap' section] of api application config
(or update application config manually with same changes as in `JsonApiBootstrap` class )
see [tests/testapp/config/api.php](./tests/testapp/config/api.php).
2. Create your controller classes by extending `JsonApiController` or `JsonApiActiveController` which contains predefined
CRUD actions.
See examples at [tests/testapp/controllers](./tests/testapp/controllers).
['bootstrap' section]: https://www.yiiframework.com/doc/guide/2.0/en/runtime-bootstrapping
### Testing
- Clone project
- Run `make up`
- Run once `make installdocker`
- Run `make testdocker` or `make cli` and inside docker env `make test`