'boolean', 'position' => PlayerPosition::class, 'goalkeeper_saves' => 'integer', 'goalkeeper_shots' => 'integer', 'goals' => 'integer', 'shots' => 'integer', ]; public function event(): BelongsTo { return $this->belongsTo(Event::class); } public function player(): BelongsTo { return $this->belongsTo(Player::class); } /** * Fangquote in Prozent (nur für Torwart). */ public function saveRate(): ?float { if (! $this->is_goalkeeper || ! $this->goalkeeper_shots || $this->goalkeeper_shots === 0) { return null; } return round(($this->goalkeeper_saves / $this->goalkeeper_shots) * 100, 1); } /** * Trefferquote in Prozent. */ public function hitRate(): ?float { if (! $this->shots || $this->shots === 0) { return null; } return round(($this->goals / $this->shots) * 100, 1); } /** * Prüft ob der Eintrag leer ist (keine relevanten Daten). */ public function isEmpty(): bool { return ! $this->is_goalkeeper && ! $this->goalkeeper_saves && ! $this->goalkeeper_shots && ! $this->goals && ! $this->shots && ! $this->note; } }