Files
nuhodds_fi4/app/Filament/Pages/Selections/LoadSeasons.php
T
2026-08-29 19:19:14 +02:00

32 lines
631 B
PHP

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