We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f31aa0 commit 43dc9aeCopy full SHA for 43dc9ae
src/Serializer.php
@@ -156,8 +156,13 @@ protected function serializeIncluded($resource)
156
if (!in_array($name, $included)) {
157
continue;
158
}
159
- if ($relationship instanceof ResourceInterface) {
160
- $data[] = $this->serializeModel($relationship);
+ if (!is_array($relationship)) {
+ $relationship = [$relationship];
161
+ }
162
+ foreach ($relationship as $model) {
163
+ if ($model instanceof ResourceInterface) {
164
+ $data[] = $this->serializeModel($model);
165
166
167
168
return $data;
0 commit comments