From f5b5dc605ea21a283983cba3b9a412a639742b20 Mon Sep 17 00:00:00 2001 From: Legacy <52163001+3m1n3nc3@users.noreply.github.com> Date: Mon, 26 Aug 2024 23:00:00 +0100 Subject: [PATCH 1/2] Update Rateable.php --- src/Rateable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Rateable.php b/src/Rateable.php index 1ebab07..d2b19fd 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(); } From ec1ac7bb0ce07da6ece6061b725f4ed6e156a401 Mon Sep 17 00:00:00 2001 From: Legacy <52163001+3m1n3nc3@users.noreply.github.com> Date: Mon, 26 Aug 2024 23:10:40 +0100 Subject: [PATCH 2/2] Fix: Allow rating user_id to be used when rating. --- src/Rateable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Rateable.php b/src/Rateable.php index d2b19fd..004076b 100755 --- a/src/Rateable.php +++ b/src/Rateable.php @@ -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); } }