Skip to content

Commit

Permalink
chore: Refactor BelongsToManyKeys class to improve code readability a…
Browse files Browse the repository at this point in the history
…nd remove unnecessary null coalescing operator
  • Loading branch information
MrPunyapal committed Aug 2, 2024
1 parent 98e069f commit e343fb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Relations/BelongsToManyKeys.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function addEagerConstraints(array $models): void
$foreignKey = $this->foreignKey;
$desireValues = [];
foreach ($localKeys as $localKey) {
$desireValues = array_merge($desireValues, $this->getKeys($models, $localKey) ?? []);
$desireValues = array_merge($desireValues, $this->getKeys($models, $localKey));
}
$this->query->whereIn($foreignKey, array_filter(array_unique($desireValues)));
}
Expand Down

0 comments on commit e343fb4

Please sign in to comment.