Files
nuhodds_fi4/app/Models/StatistikoEvent.php
T
2026-08-01 11:42:47 +02:00

71 lines
1.4 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use MongoDB\Laravel\Eloquent\Model;
class StatistikoEvent extends Model
{
protected $connection = 'mongodb';
protected $table = 'events';
protected $fillable = [
'sport_id',
'match_id',
'league_id',
'home_id',
'away_id',
'starttime',
'season',
'gls_h',
'gls_a',
'crn_h',
'crn_a',
'fls_h',
'fls_a',
'ofs_h',
'ofs_a',
'snt_h',
'snt_a',
'tsh_h',
'tsh_a',
'crd_h',
'crd_a',
'exp_home',
'exp_away',
'exp_handicap',
'exp_total',
'result_code',
'created_at',
'updated_at',
];
protected $casts = [
'starttime' => 'datetime',
];
public function sport(): BelongsTo
{
return $this->belongsTo(Sport::class, 'sport_id', 'id');
}
public function league()
{
return $this->belongsTo(SofaScoreTournament::class, 'league_id', 'tournament_id');
}
public function home(): BelongsTo
{
return $this->belongsTo(SofaScoreRosa::class, 'home_id', 'ss_team_id');
}
public function away(): BelongsTo
{
return $this->belongsTo(SofaScoreRosa::class, 'away_id', 'ss_team_id');
}
}