From 69b56bd278a504dab937b1890db3d4fca8ef6ac3 Mon Sep 17 00:00:00 2001 From: overtrue Date: Mon, 22 Jan 2024 08:45:49 +0800 Subject: [PATCH] fixed #198 --- src/Traits/Follower.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Traits/Follower.php b/src/Traits/Follower.php index b17b022..cf2cb4a 100644 --- a/src/Traits/Follower.php +++ b/src/Traits/Follower.php @@ -153,7 +153,7 @@ public function attachFollowStatus($followables, callable $resolver = null) $item = $followed->where('followable_id', $followable->getKey()) ->where('followable_type', $followable->getMorphClass()) ->first(); - $followable->setAttribute('has_followed', !!$item); + $followable->setAttribute('has_followed', (bool) $item); $followable->setAttribute('followed_at', $item ? $item->created_at : null); $followable->setAttribute('follow_accepted_at', $item ? $item->accepted_at : null); }