insolita / yii2-fractal
Json-api spec implementation with league/fractal
Installs: 10 595
Dependents: 1
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 5
Open Issues: 2
Requires
- php: >=7.1.0
- ext-json: *
- league/fractal: ^0.19.2
- yiisoft/yii2: ~2.0.15
Requires (Dev)
- cebe/indent: *
- codeception/assert-throws: ^1.0
- codeception/codeception: ^4.1
- codeception/module-asserts: ^1.0.0
- codeception/module-db: ^1.0
- codeception/module-phpbrowser: ^1.0.0
- codeception/module-rest: <1.3.0
- codeception/module-yii2: ^1.1
- codeception/verify: ^1.5
- friendsofphp/php-cs-fixer: ~2.16
- fzaninotto/faker: ^1.9
This package is auto-updated.
Last update: 2024-10-25 07:49:55 UTC
README
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
-
Add class
insolita\fractal\JsonApiBootstrap
to the 'bootstrap' section of api application config (or update application config manually with same changes as inJsonApiBootstrap
class ) see tests/testapp/config/api.php. -
Create your controller classes by extending
JsonApiController
orJsonApiActiveController
which contains predefined CRUD actions. See examples at tests/testapp/controllers.
Testing
- Clone project
- Run
make up
- Run once
make installdocker
- Run
make testdocker
ormake cli
and inside docker envmake test