- PlayerPosition Enum (7 Handball-Positionen) mit Label/ShortLabel - Spielerstatistik pro Spiel (Tore, Würfe, TW-Paraden, Bemerkung) - Position-Dropdown in Spieler-Editor und Event-Stats-Formular - Statistik-Seite: TW zuerst, Trennlinie, Feldspieler, Position-Badges - Spielfeld-SVG mit Ampel-Performance (grün/gelb/rot) - Anklickbare Spieler im Spielfeld öffnen Detail-Modal - Fahrgemeinschaften (Anbieten, Zuordnen, Zurückziehen) - Übersetzungen in allen 6 Sprachen (de, en, pl, ru, ar, tr) - .gitignore für Laravel hinzugefügt - Demo-Daten mit Positionen und Statistiken Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
36 lines
777 B
PHP
36 lines
777 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class EventCarpoolPassenger extends Model
|
|
{
|
|
public $timestamps = false;
|
|
|
|
protected $fillable = ['carpool_id', 'player_id'];
|
|
|
|
protected static function booted(): void
|
|
{
|
|
static::creating(function (self $model) {
|
|
$model->created_at = $model->freshTimestamp();
|
|
});
|
|
}
|
|
|
|
public function carpool(): BelongsTo
|
|
{
|
|
return $this->belongsTo(EventCarpool::class, 'carpool_id');
|
|
}
|
|
|
|
public function player(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Player::class);
|
|
}
|
|
|
|
public function addedByUser(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'added_by');
|
|
}
|
|
}
|