hasMany(Vote::class); } public function getAverageScoreAttribute() { return $this->votes->avg('score'); } }