Skip to content

Commit

Permalink
Fix: Allow rating user_id to be used when rating. (#70)
Browse files Browse the repository at this point in the history
* Update Rateable.php

* Fix: Allow rating user_id to be used when rating.
  • Loading branch information
3m1n3nc3 authored Nov 10, 2024
1 parent b441472 commit 9c74590
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Rateable.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ trait Rateable
*/

private function byUser($user_id = null) {
if(!! $user_id) {
if(! $user_id) {
return Auth::id();
}

Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 9c74590

Please sign in to comment.