hasMany(User::class); } public function users(): HasMany { return $this->hasMany(User::class); } public function emailDomains(): HasMany { return $this->hasMany(SchoolEmailDomain::class); } /** TODO: Remove this and concepts of profile picture */ /** @codeCoverageIgnore */ public function initialLetterImageURL($bg_color = '4f46e5', $text_color = 'fff'): string { $img = "https://ui-avatars.com/api/?background=$bg_color&color=$text_color&name="; $img .= substr($this->name, 0, 1); return $img; } public function students(): HasMany { return $this->hasMany(Student::class)->orderBy('last_name')->orderBy('first_name'); } public function entries(): HasManyThrough { return $this->hasManyThrough( Entry::class, Student::class, 'school_id', 'student_id', 'id', 'id'); } public function nominations(): HasManyThrough { return $this->hasManyThrough( NominationEnsembleEntry::class, Student::class, 'school_id', 'student_id', 'id', 'id'); } }