PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Insolita   Yii2 Fractal   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Yii2 Fractal
Components to implement API based on JSON:API
Author: By
Last change:
Date: 2 months ago
Size: 1,069 bytes
 

Contents

Class file image Download

yii2-fractal Beta

yii2-fractal

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.
  2. Create your controller classes by extending `JsonApiController` or `JsonApiActiveController` which contains predefined CRUD actions. See examples at 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