Files
nuhodds_fi4/app/Actions/LoadStatisticFixturesMatchOptions.php
T
2026-07-30 19:00:24 +02:00

24 lines
534 B
PHP

<?php
namespace App\Actions;
use App\Models\StatisticFixtures;
class LoadStatisticFixturesMatchOptions
{
public static function load(int | null $league_id)
{
if (! $league_id) {
return [];
}
$res = StatisticFixtures::where('league_id', $league_id)->get();
$arr = [];
foreach ($res as $val) {
$arr[$val->id] = $val->starttime->format('Y-m-d H:i') . ' - ' . $val->home->ss_team_name . ' vs ' . $val->away->ss_team_name;
}
return $arr;
}
}