From 197b287a3b696253c8eefa8b4ce4833caeecfab1 Mon Sep 17 00:00:00 2001 From: Punyapal Shah Date: Sat, 21 Sep 2024 23:20:59 +0530 Subject: [PATCH] chore: phpstan error --- app/Livewire/Home/Users.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Livewire/Home/Users.php b/app/Livewire/Home/Users.php index c4c6a5693..b494e9bdb 100644 --- a/app/Livewire/Home/Users.php +++ b/app/Livewire/Home/Users.php @@ -8,6 +8,7 @@ use App\Models\User; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; +use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Support\Facades\Cache; use Illuminate\View\View; use Livewire\Attributes\Url; @@ -83,11 +84,11 @@ private function defaultUsers(): Collection ->load('links') ->when(auth()->check(), function (Collection $users): void { $users->loadExists([ - 'following as is_follower' => function (Builder $query): void { - $query->where('user_id', auth()->id()); + 'following as is_follower' => function (Relation $relation): void { + $relation->getQuery()->where('user_id', auth()->id()); }, - 'followers as is_following' => function (Builder $query): void { - $query->where('follower_id', auth()->id()); + 'followers as is_following' => function (Relation $relation): void { + $relation->getQuery()->where('follower_id', auth()->id()); }, ]); });