I am trying to display average of column which has same user_id:
$average = Rating::average(
[
'column' => 'rating',
'group' => 'user_id',
]
);
$this->view-> averages = $average;
Volt:
{% for average in averages %}
<tr>
<td>{{ averages.rating }}</td>
</tr>
{% endfor %}
But it returns all the values, not average of values with same user_id.