'boolean', ]; } public function players(): HasMany { return $this->hasMany(Player::class); } public function events(): HasMany { return $this->hasMany(Event::class); } public function activePlayers(): HasMany { return $this->hasMany(Player::class)->where('is_active', true); } public function coaches(): BelongsToMany { return $this->belongsToMany(User::class, 'team_user') ->withPivot('created_at'); } public function files(): BelongsToMany { return $this->belongsToMany(File::class, 'team_file') ->withPivot('created_at'); } public function parentReps(): Collection { return User::where('role', UserRole::ParentRep) ->where('is_active', true) ->whereHas('children', fn ($q) => $q->where('team_id', $this->id)) ->orderBy('name') ->get(); } public function scopeActive($query) { return $query->where('is_active', true); } }