From 4dce4d40a346f0d80c46f780c9a1dfc2bfa706a7 Mon Sep 17 00:00:00 2001 From: Sami Mazouz Date: Fri, 13 Dec 2024 13:06:08 +0100 Subject: [PATCH] fix(regression): phpstan errors --- framework/core/src/Database/Eloquent/Collection.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/core/src/Database/Eloquent/Collection.php b/framework/core/src/Database/Eloquent/Collection.php index ef5c5fe87d..a9eda56003 100644 --- a/framework/core/src/Database/Eloquent/Collection.php +++ b/framework/core/src/Database/Eloquent/Collection.php @@ -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();