Skip to main content

"Black Friday" Discount! Only until December 1st: 50% off all membership plans!

Read more here

tighten/novapackages

337 stars
1 code files
View tighten/novapackages on GitHub

app/RatingCountable.php

Open in GitHub
trait RatingCountable
{
//
protected function ratingsCountsFromEagerLoad()
{
return $this->ratings->groupBy('rating')->map(function ($ratings) {
return $ratings->count();
});
}
//
}