32 lines
631 B
PHP
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;
|
|
}
|
|
}
|