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.
whereIn()
1 parent 8c6a8c4 commit bd98bd6Copy full SHA for bd98bd6
src/Traits/HasRelations.php
@@ -396,7 +396,9 @@ protected function relationsAfterFind(array $eventData): array
396
}
397
} else {
398
foreach ($this->relations as $relationName => $relationObject) {
399
- $ids = array_column($eventData['data'], $relationObject->primaryKey);
+ $ids = array_column($eventData['data'], $relationObject->primaryKey);
400
+ $ids = array_unique($ids, SORT_NUMERIC);
401
+ sort($ids);
402
$relationData = $this->getDataForRelationByIds($ids, $relationObject, $relationName);
403
404
foreach ($eventData['data'] as &$data) {
0 commit comments