Skip to content

Commit

Permalink
ofMany to decide relationship name when it is null (#38889)
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarNaliyapara authored Sep 21, 2021
1 parent cb72e7b commit f267d7c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand All @@ -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);
}

/**
Expand Down

0 comments on commit f267d7c

Please sign in to comment.