Skip to content

Commit

Permalink
fix(regression): phpstan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SychO9 committed Dec 13, 2024
1 parent a81d13e commit 4dce4d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion framework/core/src/Database/Eloquent/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,14 @@ protected function loadMissingRelation(BaseCollection $models, array $path): voi
$relation = reset($relation);
}

// @phpstan-ignore-next-line
$models->filter(fn ($model) => ! is_null($model) && ! $model->relationLoaded($name))->load($relation);

if (empty($path)) {
return;
}

$models = $models->pluck($name)->where(fn (mixed $relation) => $relation !== null);
$models = $models->pluck($name)->filter();

if ($models->first() instanceof \Illuminate\Support\Collection) {
$models = $models->collapse();
Expand Down

0 comments on commit 4dce4d4

Please sign in to comment.