diff --git a/app/Filament/Pages/Statistic.php b/app/Filament/Pages/Statistic.php
index fade22ff..4e98d3c8 100644
--- a/app/Filament/Pages/Statistic.php
+++ b/app/Filament/Pages/Statistic.php
@@ -46,26 +46,26 @@ class Statistic extends BaseDashboard
public function resetFilters(): void
{
$filters = array_keys($this->filters);
- foreach($filters as $filter){
- switch($filter){
+ foreach ($filters as $filter) {
+ switch ($filter) {
case 'accuracy':
$this->filters[$filter] = 0.125;
- break;
+ break;
case 'similar_past_matches':
$this->filters[$filter] = 'none';
- break;
+ break;
case 'team_position':
$this->filters[$filter] = 'all';
- break;
+ break;
case 'statistic_type':
$this->filters[$filter] = 'gls';
- break;
+ break;
case 'season_or_date':
$this->filters[$filter] = 'season';
- break;
+ break;
default;
$this->filters[$filter] = null;
- break;
+ break;
}
}
}
@@ -96,7 +96,7 @@ class Statistic extends BaseDashboard
// '2' => 'icon-icehockey',
// '5' => 'icon-tennisball',
// ]),
-
+
Grid::make([
'default' => 1,
'sm' => 3,
@@ -108,10 +108,10 @@ class Statistic extends BaseDashboard
->live()
->preload()
->searchable(false)
- ->prefixIconColor(fn (Get $get): string => $get('sofascore_category_id') ? 'success' : 'danger')
+ ->prefixIconColor(fn(Get $get): string => $get('sofascore_category_id') ? 'success' : 'danger')
->prefixIcon('phosphor-globe-fill')
->hiddenLabel()
- ->options(fn () => LoadSofaScoreCategory::load())
+ ->options(fn() => LoadSofaScoreCategory::load())
->placeholder('Country')
->afterStateUpdated(function (callable $set) {
$set('league_id', null);
@@ -123,11 +123,11 @@ class Statistic extends BaseDashboard
Select::make('league_id')
->live()
->preload()
- ->prefixIconColor(fn (Get $get): string => $get('league_id') ? 'success' : 'danger')
+ ->prefixIconColor(fn(Get $get): string => $get('league_id') ? 'success' : 'danger')
->prefixIcon('phosphor-trophy-fill')
->hiddenLabel()
// ->options(fn(Get $get) => SofaScoreTournament::with('sofascore_category')->where('sofa_score_category_id', $get('sofascore_category_id'))->pluck('name', 'tournament_id'))
- ->options(fn (Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('sofascore_category_id')))
+ ->options(fn(Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('sofascore_category_id')))
->placeholder('League')
->afterStateUpdated(function (callable $set, $state) {
$set('match_id', null);
@@ -138,7 +138,7 @@ class Statistic extends BaseDashboard
Select::make('match_id')
->live()
->hiddenLabel()
- ->prefixIconColor(fn (Get $get): string => $get('match_id') ? 'success' : 'danger')
+ ->prefixIconColor(fn(Get $get): string => $get('match_id') ? 'success' : 'danger')
->prefixIcon('phosphor-calendar-check-fill')
->options(function (Get $get) {
return LoadStatisticFixturesMatchOptions::load($get('league_id'));
@@ -162,7 +162,7 @@ class Statistic extends BaseDashboard
}
})
->prefixIcon('phosphor-users-three-fill')
- ->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
+ ->hidden(fn(Get $get) => $get('similar_past_matches') != 'none')
->options(function (Get $get) {
if ($get('match_id')) {
$res = StatisticFixtures::where('id', $get('match_id'))->first();
@@ -190,9 +190,9 @@ class Statistic extends BaseDashboard
Action::make('iconInfo')
->color('success')
->icon('phosphor-question-fill')
- ->tooltip(fn () => 'Team Position')
+ ->tooltip(fn() => 'Team Position')
)
- ->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
+ ->hidden(fn(Get $get) => $get('similar_past_matches') != 'none')
->default('all')
->selectablePlaceholder(false)
->options([
@@ -245,13 +245,13 @@ class Statistic extends BaseDashboard
->hiddenLabel()
->prefix('SPM')
->placeholder('Similar Past Matches')
- ->suffix(fn (Get $get): string|HtmlString => $get('similar_past_matches') != 'none' ? new HtmlString('
± '.$get('accuracy').'
') : '')
+ ->suffix(fn(Get $get): string|HtmlString => $get('similar_past_matches') != 'none' ? new HtmlString('± ' . $get('accuracy') . '
') : '')
->prefixAction(
Action::make('iconInfo')
->icon('phosphor-question-fill')
// ->color(fn(Get $get): string => $get('similar_past_matches') != 'none' ? 'success' : 'primary')
->color('success')
- ->tooltip(fn () => $this->tooltip_similar_past_matches())
+ ->tooltip(fn() => $this->tooltip_similar_past_matches())
)
->default('none')
->selectablePlaceholder(false)
@@ -271,7 +271,7 @@ class Statistic extends BaseDashboard
Slider::make('accuracy')
->live()
->hiddenLabel()
- ->hidden(fn (Get $get) => $get('similar_past_matches') == 'none')
+ ->hidden(fn(Get $get) => $get('similar_past_matches') == 'none')
->fillTrack()
->minValue(0)
->maxValue(0.25)
@@ -290,17 +290,17 @@ class Statistic extends BaseDashboard
->hiddenLabel()
->allowHtml()
->placeholder('Player')
- ->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
- ->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'success' : '')
+ ->hidden(fn(Get $get) => $get('similar_past_matches') != 'none')
+ ->prefixIconColor(fn(Get $get): string => $get('similar_past_matches') == 'none' ? 'success' : '')
->prefixIcon('icon-player')
->preload()
->searchable()
- ->extraAttributes(fn () => ['id' => 'player_selector'])
+ ->extraAttributes(fn() => ['id' => 'player_selector'])
->suffixAction(
Action::make('iconInfo')
->icon('phosphor-question-fill')
->color('success')
- ->tooltip(fn () => $this->tooltip_player_info())
+ ->tooltip(fn() => $this->tooltip_player_info())
)
->options(function (Get $get) {
return LoadPlayer::load($get);
@@ -311,7 +311,7 @@ class Statistic extends BaseDashboard
->placeholder('Time on field')
->prefixIcon('phosphor-watch-fill')
->default('all')
- ->hidden(fn (Get $get) => ! $get('ss_player_id'))
+ ->hidden(fn(Get $get) => ! $get('ss_player_id'))
->prefixIconColor('success')
->selectablePlaceholder(false)
->options([
@@ -331,6 +331,7 @@ class Statistic extends BaseDashboard
->extraAttributes([
'class' => 'radio-statistic-group',
])
+ ->hidden(fn(Get $get) => $get('similar_past_matches') != 'none')
->columnSpan([
'default' => 4,
'sm' => 4,
@@ -351,7 +352,7 @@ class Statistic extends BaseDashboard
->placeholder('Current Season')
->prefixIconColor('success')
// ->prefixIconColor(fn(Get $get): string => $get('season') ? 'success' : 'primary')
- ->hidden(fn (Get $get) => $get('season_or_date') == 'date')
+ ->hidden(fn(Get $get) => $get('season_or_date') == 'date' || $get('similar_past_matches') != 'none')
->prefixIcon('phosphor-calendar-star-fill')
->options(function (Get $get) {
return LoadSeasons::load($get('sofascore_category_id'));
@@ -362,32 +363,33 @@ class Statistic extends BaseDashboard
DatePicker::make('start_date')
->live()
->hiddenLabel()
- ->hidden(fn (Get $get) => $get('season_or_date') == 'season')
+ ->hidden(fn(Get $get) => $get('season_or_date') == 'season')
->native(false)
- ->prefixIconColor(fn (Get $get): string => $get('start_date') ? 'success' : 'primary')
+ ->prefixIconColor(fn(Get $get): string => $get('start_date') ? 'success' : 'primary')
->prefixIcon('phosphor-calendar-fill')
->prefix('Start')
->suffixAction(
Action::make('clear_start')
->icon('phosphor-x')
->color('gray')
- ->action(fn (Set $set) => $set('start_date', null))
+ ->action(fn(Set $set) => $set('start_date', null))
),
DatePicker::make('end_date')
->live()
->hiddenLabel()
- ->hidden(fn (Get $get) => $get('season_or_date') == 'season')
+ ->hidden(fn(Get $get) => $get('season_or_date') == 'season')
->native(false)
- ->prefixIconColor(fn (Get $get): string => $get('end_date') ? 'success' : 'primary')
+ ->prefixIconColor(fn(Get $get): string => $get('end_date') ? 'success' : 'primary')
->prefixIcon('phosphor-calendar-fill')
->prefix('End')
->suffixAction(
Action::make('clear_end')
->icon('phosphor-x')
->color('gray')
- ->action(fn (Set $set) => $set('end_date', null))
+ ->action(fn(Set $set) => $set('end_date', null))
),
Action::make('esc')
+ ->label('Reset [esc]')
->icon('phosphor-x-circle')
->color('gray')
->keyBindings(['esc'])