The code below works, but I wanted to know how to do it all right in query , and if the way I'm setting it up is really the best way.
$query = Avaliar::select(DB::raw('COUNT(id) as contar'), DB::raw('SUM(nota) as total'))
->where('serie_id', $serie->id)
->first();
$nota = $query->total / $query->contar;