diff --git a/src/Listeners/SaveVotesToDatabase.php b/src/Listeners/SaveVotesToDatabase.php index 1d4f826..cf5fea6 100644 --- a/src/Listeners/SaveVotesToDatabase.php +++ b/src/Listeners/SaveVotesToDatabase.php @@ -76,7 +76,7 @@ public function whenPostWillBeSaved(PostWillBeSaved $event) if ($vote->type == 'Up') { $post->user->decrement('votes'); - if ($post->number = 1) { + if ($post->number == 1) { $discussion->decrement('votes'); } @@ -86,7 +86,7 @@ public function whenPostWillBeSaved(PostWillBeSaved $event) } else { $post->user->increment('votes'); - if ($post->number = 1) { + if ($post->number == 1) { $discussion->increment('votes'); } @@ -102,7 +102,7 @@ public function whenPostWillBeSaved(PostWillBeSaved $event) $post->user->votes = $post->user->votes - 2; - if ($post->number = 1) { + if ($post->number == 1) { $discussion->votes = $discussion->votes - 2; } @@ -116,7 +116,7 @@ public function whenPostWillBeSaved(PostWillBeSaved $event) $post->user->votes = $post->user->votes + 2; - if ($post->number = 1) { + if ($post->number == 1) { $discussion->votes = $discussion->votes + 2; } @@ -129,7 +129,7 @@ public function whenPostWillBeSaved(PostWillBeSaved $event) $post->user->decrement('votes'); - if ($post->number = 1) { + if ($post->number == 1) { $discussion->decrement('votes'); } @@ -141,7 +141,7 @@ public function whenPostWillBeSaved(PostWillBeSaved $event) $post->user->increment('votes'); - if ($post->number = 1) { + if ($post->number == 1) { $discussion->increment('votes'); }