This commit is contained in:
salam committed 2026-10-04 15:25:03 +02:00
1 parent 9bcd4432c6
commit 6f92f9e1d5
1209 files changed
+220940

No files matched your search

+57
View File
@@ -0,0 +1,57 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Prunable;
use Illuminate\Support\Carbon;
class StatisticFixtures extends Model
{
use Prunable;
protected $fillable = [
'sport_id',
'league_id',
'home_id',
'away_id',
'starttime',
'exp_home',
'exp_away',
];
protected function casts(): array
{
return [
'starttime' => 'datetime',
];
}
/**
* Get the prunable model query.
*/
public function prunable()
{
return static::where('starttime', '<', Carbon::now('Europe/Vienna')->subMinutes(5));
}
public function sport()
{
return $this->belongsTo(Sport::class)->where('is_active', 1);
}
public function league()
{
return $this->belongsTo(SofaScoreTournament::class, 'league_id', 'tournament_id');
}
public function home()
{
return $this->belongsTo(SofaScoreRosa::class, 'home_id', 'ss_team_id');
}
public function away()
{
return $this->belongsTo(SofaScoreRosa::class, 'away_id', 'ss_team_id');
}
}