diff --git a/src/Illuminate/Database/Eloquent/Relations/Concerns/CanBeOneOfMany.php b/src/Illuminate/Database/Eloquent/Relations/Concerns/CanBeOneOfMany.php index 71fa6bde3178..6ea802bace1b 100644 --- a/src/Illuminate/Database/Eloquent/Relations/Concerns/CanBeOneOfMany.php +++ b/src/Illuminate/Database/Eloquent/Relations/Concerns/CanBeOneOfMany.php @@ -137,7 +137,7 @@ public function latestOfMany($column = 'id', $relation = null) { return $this->ofMany(collect(Arr::wrap($column))->mapWithKeys(function ($column) { return [$column => 'MAX']; - })->all(), 'MAX', $relation ?: $this->guessRelationship()); + })->all(), 'MAX', $relation); } /** @@ -152,7 +152,7 @@ public function oldestOfMany($column = 'id', $relation = null) { return $this->ofMany(collect(Arr::wrap($column))->mapWithKeys(function ($column) { return [$column => 'MIN']; - })->all(), 'MIN', $relation ?: $this->guessRelationship()); + })->all(), 'MIN', $relation); } /**