I'm making a feedback stars rating system for products using Laravel with MySQL, how can I make MySQL count all rates and get the average of 5 stars?
So by laravel I am going to just use get()
to get the average.
//sample data:
id | rate
1 4
2 2
//expected output:
3