I realise in Laravel 5 Eloquent there is a function called groupBy. I usually used it like so
->groupBy('rating');
Let's say in rating column, there are 3 types of ratings in integer : 1,2 and 3
How do I limit it to 10 records for each kind of rating? Preferably using Eloquent but if that's not possible, I'll still accept query builder method.