From cfcca8beaaf2fbe7d297edc7a4731f3328db381a Mon Sep 17 00:00:00 2001 From: issyrocks12 Date: Tue, 25 Apr 2017 20:20:04 +0000 Subject: [PATCH] Fix upvote error --- src/Listeners/SaveVotesToDatabase.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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'); }