Skip to content

Commit bda7fb8

Browse files
committed
Count with query
1 parent fb6a44d commit bda7fb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/Helpers/HasLikes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ public function isLikedBy(User $user): bool
4141

4242
public function getLikesCountAttribute(): int
4343
{
44-
return $this->likes->count();
44+
return $this->likes()->count();
4545
}
4646
}

0 commit comments

Comments
 (0)