| 1 | <?php |
||
| 17 | trait FractalTrait |
||
| 18 | { |
||
| 19 | |||
| 20 | /** |
||
| 21 | * By default the Dingo API package (in the config file) creates an instance of the |
||
| 22 | * fractal manager which takes the default serializer (specified by the fractal |
||
| 23 | * package itself, and there's no way to override change it from the configurations of |
||
| 24 | * the Dingo package). |
||
| 25 | * |
||
| 26 | * Here I am replacing the current default serializer (DataArraySerializer) by the |
||
| 27 | * (JsonApiSerializer). |
||
| 28 | * |
||
| 29 | * "Serializers are what build the final response after taking the transformers data". |
||
| 30 | */ |
||
| 31 | public function overrideDefaultFractalSerializer() |
||
| 56 | |||
| 57 | } |
||
| 58 |