The property likes_count does not seem to exist on Usamamuneerchaudhary\Commentify\Models\Comment. Are you sure there is no database migration missing?
Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.
Loading history...
23
}
24
25
public function like(): void
26
{
27
$ip = request()->ip();
28
$userAgent = request()->userAgent();
29
if ($this->comment->isLiked()) {
30
$this->comment->removeLike();
31
32
$this->count--;
33
} elseif (auth()->user()) {
34
$this->comment->likes()->create([
35
'user_id' => auth()->id(),
36
]);
37
38
$this->count++;
39
40
if (config('commentify.enable_notifications', false)) {
Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.