From 9c745904770bb3e3f68938287f7254743017739b Mon Sep 17 00:00:00 2001 From: Legacy <52163001+3m1n3nc3@users.noreply.github.com> Date: Sun, 10 Nov 2024 21:40:13 +0100 Subject: [PATCH] Fix: Allow rating user_id to be used when rating. (#70) * Update Rateable.php * Fix: Allow rating user_id to be used when rating. --- src/Rateable.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Rateable.php b/src/Rateable.php index 1ebab07..004076b 100755 --- a/src/Rateable.php +++ b/src/Rateable.php @@ -18,7 +18,7 @@ trait Rateable */ private function byUser($user_id = null) { - if(!! $user_id) { + if(! $user_id) { return Auth::id(); } @@ -56,7 +56,7 @@ public function rateOnce($value, $comment = null, $user_id = null) $rating->comment = $comment; $rating->save(); } else { - $this->rate($value, $comment); + $this->rate($value, $comment, $user_id); } }