'---', 'YS' => 'Youth Small', 'YM' => 'Youth Medium', 'YL' => 'Youth Large', 'YXL' => 'Youth Extra Large', 'S' => 'Small', 'M' => 'Medium', 'L' => 'Large', 'XL' => 'Extra Large', '2XL' => '2XL', '3XL' => '3XL', ]; protected $guarded = []; protected function casts(): array { return [ 'optional_data' => 'array', ]; } public function nominations(): HasMany { return $this->hasMany(NominationEnsembleEntry::class); } public function school(): BelongsTo { return $this->belongsTo(School::class); } public function historicalSeats(): HasMany { return $this->hasMany(HistoricalSeat::class); } public function users(): HasManyThrough { return $this->hasManyThrough( User::class, // The target model we want to access School::class, // The intermediate model through which we access the target model 'id', // The foreign key on the intermediate model 'school_id', // The foreign key on the target model 'school_id', // The local key 'id' // The local key on the intermediate model ); } public function directors(): HasManyThrough { return $this->users(); } public function entries(): HasMany { return $this->hasMany(Entry::class); } public function full_name(bool $last_name_first = false): string { if ($last_name_first) { return $this->last_name.', '.$this->first_name; } return $this->first_name.' '.$this->last_name; } public function doublerRequests(): HasMany { return $this->hasMany(DoublerRequest::class); } }