laravel-review-rateable
laravel-review-rateable copied to clipboard
Wrong data resualt when using this method getApprovedRatings() with two different models.
Hello, guys, we are using your package and when using this method getApprovedRatings() with two different models we are getting a wrong result for example like this.
Here you must use the polymorph relationship to call the rates.
Thanks a lot.
I will look into this when I have time. If you have a fix ready you can send a pull request.
@DevYSM Have you checked that the reviewrateable_id for the App\Models\Admin and App\Models\User are not both "2".
It is entirely possible that when the Admin that is being reviewed indeed has an ID of 2 and the gym entry also has and ID of 2. As this references the actual ID for the Model that is being reviewed.
Basically from the results:
Admin with an ID of 2 was rated by User with an ID of 1 Gym with an ID of 2 was rated by User with and ID of 1
It is returning the proper output.