This commit is contained in:
salam committed 2026-06-17 15:51:03 +02:00
1 parent ec60adb074
commit f17a70ce7c
4 files changed
+62 -23

No files matched your search

+26 -17
View File
@@ -58,7 +58,8 @@ class Statistic extends BaseDashboard
Grid::make([
'default' => 1,
'sm' => 3,
'md' => 5,
'md' => 4,
'xl' => 5,
])
->columnSpanFull()
->extraAttributes([
@@ -77,6 +78,7 @@ class Statistic extends BaseDashboard
$set('match_id', null);
$set('team_id', null);
$set('tm_player_id', null);
$set('season', null);
}),
Select::make('match_id')
->hiddenLabel()
@@ -136,20 +138,6 @@ class Statistic extends BaseDashboard
'home' => 'Home',
'away' => 'Away',
]),
Select::make('season')
->hiddenLabel()
->placeholder('Season')
->hidden(fn(Get $get) => $get('season_or_date') == 'date')
->prefixIcon('phosphor-calendar-star')
->prefixIconColor('primary')
->options(function (Get $get) {
return LoadSeasons::load($get('league_id'));
})
->afterStateUpdated(function (callable $set) {
$set('team_id', null);
$set('tm_player_id', null);
})
->live(),
Select::make('statistic_type')
->hiddenLabel()
->placeholder('Statistic Type')
@@ -247,6 +235,23 @@ class Statistic extends BaseDashboard
'substituted' => 'Substituted',
])
->live(),
Select::make('season')
->columns(2)
->hiddenLabel()
->multiple()
->placeholder('Season')
->hidden(fn(Get $get) => $get('season_or_date') == 'date')
->prefixIcon('phosphor-calendar-star')
->prefixIconColor('primary')
->preload()
->options(function (Get $get) {
return LoadSeasons::load($get('league_id'));
})
->afterStateUpdated(function (callable $set) {
$set('team_id', null);
$set('tm_player_id', null);
})
->live(),
DatePicker::make('start_date')
->hiddenLabel()
->hidden(fn(Get $get) => $get('season_or_date') == 'season')
@@ -276,14 +281,18 @@ class Statistic extends BaseDashboard
->action(fn(Set $set) => $set('end_date', null))
),
Radio::make('season_or_date')
->columnSpan(2)
->columnSpan([
'default' => 1,
'sm' => 2,
'md' => 3,
])
->inline()
->live()
->default('season')
->hiddenLabel()
->options([
'season' => 'Season',
'date' => 'Date Picker',
'date' => 'Date',
]),
]),
]);