Files
nuhodds_fi4/app/Actions/Selections/LoadSeasons.php
T
2026-06-18 17:17:52 +02:00

31 lines
641 B
PHP

<?php
namespace App\Actions\Selections;
use App\Models\StatistikoEvent;
class LoadSeasons
{
public static function load($league_id)
{
// $res = CompetitionGroup::with('country')->where('id', $league_id)->first();
// $season_mode = $res->country->season_mode;
$res = StatistikoEvent::where('league_id', $league_id)
->groupBy('season')
->orderBy('starttime', 'ASC')
->get();
if (! $res) {
return [];
}
$arr = [];
foreach ($res as $val) {
$arr[$val->season] = $val->season;
}
return $arr;
}
}