From 3b8f13784b53f70c7f913e54e36218352218a681 Mon Sep 17 00:00:00 2001 From: Shlee Date: Tue, 4 Nov 2025 17:38:19 +1030 Subject: [PATCH] =?UTF-8?q?Update=20Bouncer.php=20-=20Called=20'count'=20o?= =?UTF-8?q?n=20Laravel=20collection,=20but=20could=20have=20been=20retriev?= =?UTF-8?q?ed=20as=20a=20query.=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=F0=9F=AA=AA=20=20larastan.noUnnecessaryCollectionCall?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Util/Sentiment/Bouncer.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/Util/Sentiment/Bouncer.php b/app/Util/Sentiment/Bouncer.php index 5dc405520..63510df68 100644 --- a/app/Util/Sentiment/Bouncer.php +++ b/app/Util/Sentiment/Bouncer.php @@ -47,9 +47,8 @@ class Bouncer { return false; } - $count = Status::select('id', 'scope') - ->whereScope('public') - ->find($ids) + $count = Status::whereScope('public') + ->whereIn('id', $ids) ->count(); return $count >= 1 ? true : false;