-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help with the implementation #37
Comments
@dev-humayun Do you mean you want to get the average rating for every post in the table? |
yes exactly |
I will work on this and tray and get it into the next release. In the meantime, if anyone has implemented it and wants to make a pull request it would be greatly appreciated. |
Hello there, thanks for the package. I am trying to get all ratings for user model by doing this
but no luck. |
@dev-humayun did you work around this issue? |
@H4ck3r-x0 You can get all the ratings for a user by doing something like: $user = User::find(1);
$ratings = $user->getRecentUserRatings($user->id); You can also just call it like this: use Codebyray\ReviewRateable\Models\Rating;
$rating = new Rating;
// Find a user
$user = User::find(1);
$ratings = $rating->getRecentUserRatings($user->id); You can limit the number of ratings returned as well as get approved or not approved. /**
* @param $id - Users ID
* @param $limit
* @param $approved
* @param $sort
*/
public function getRecentUserRatings($id, $limit = 5, $approved = true, $sort = 'desc'); |
@H4ck3r-x0 yes i worked on it and get all the rating Sorry couldnot respond earlier |
@codebyray Thanks for your reply, what I want is I have a list of users and have a filter, so i want to filter the users by their ratings |
@dev-humayun Can tell me how did you do it? |
Can we get the average rating of all the Posts
like
The text was updated successfully, but these errors were encountered: