1 | <?php |
||
21 | class DataNormalizer |
||
22 | { |
||
23 | /** |
||
24 | * Normalize the data for a resource. |
||
25 | * |
||
26 | * @param mixed $data |
||
27 | * @return mixed |
||
28 | */ |
||
29 | public function normalize($data = null) |
||
41 | |||
42 | /** |
||
43 | * Normalize a relationship. |
||
44 | * |
||
45 | * @param \Illuminate\Database\Eloquent\Relations\Relation $relation |
||
46 | * @return \Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model|null |
||
47 | */ |
||
48 | protected function normalizeRelation(Relation $relation) |
||
52 | |||
53 | /** |
||
54 | * Indicates if a relationship is singular. |
||
55 | * |
||
56 | * @param \Illuminate\Database\Eloquent\Relations\Relation $relation |
||
57 | * @return bool |
||
58 | */ |
||
59 | protected function isSingularRelation(Relation $relation): bool |
||
71 | } |