From e343fb4300d76ec50b98861a259d332520a88862 Mon Sep 17 00:00:00 2001 From: Punyapal Shah Date: Fri, 2 Aug 2024 21:20:27 +0530 Subject: [PATCH] chore: Refactor BelongsToManyKeys class to improve code readability and remove unnecessary null coalescing operator --- src/Relations/BelongsToManyKeys.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Relations/BelongsToManyKeys.php b/src/Relations/BelongsToManyKeys.php index 387e1c6..02926e9 100644 --- a/src/Relations/BelongsToManyKeys.php +++ b/src/Relations/BelongsToManyKeys.php @@ -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))); }