1 | <?php |
||
8 | trait JsonApiTransforms |
||
9 | { |
||
10 | /** |
||
11 | * Transform a model instance into a JSON API object. |
||
12 | * |
||
13 | * @param \Illuminate\Database\Eloquent\Model $record |
||
14 | * @param array|null $fields Field subset to return |
||
15 | * @param array|null $include Relations to include |
||
16 | * |
||
17 | * @return array |
||
18 | */ |
||
19 | protected function transformRecord($record, array $fields = [], array $include = []) |
||
60 | |||
61 | /** |
||
62 | * Transform a set of models into a JSON API collection. |
||
63 | * |
||
64 | * @param \Illuminate\Support\Collection $records |
||
65 | * @param array $fields |
||
66 | * |
||
67 | * @return array |
||
68 | */ |
||
69 | protected function transformCollection($records, array $fields = []) |
||
77 | |||
78 | /** |
||
79 | * Transform a set of models into a collection of JSON API resource |
||
80 | * identifier objects. |
||
81 | * |
||
82 | * @param \Illuminate\Support\Collection $records |
||
83 | * |
||
84 | * @return array |
||
85 | */ |
||
86 | protected function transformCollectionIds($records) |
||
97 | } |
||
98 |