From c99ba7219f919c0fbdd14884b29ac341d3f72f3d Mon Sep 17 00:00:00 2001 From: salam Date: Mon, 25 May 2026 17:13:07 +0200 Subject: [PATCH] wip --- app/Filament/Pages/Statistic.php | 39 +++++++++++++----------- app/Filament/Widgets/Data/LoadEvents.php | 2 +- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/app/Filament/Pages/Statistic.php b/app/Filament/Pages/Statistic.php index debab141..a79a3300 100644 --- a/app/Filament/Pages/Statistic.php +++ b/app/Filament/Pages/Statistic.php @@ -19,7 +19,7 @@ use Filament\Forms\Components\Select; use Filament\Forms\Components\Slider; use Filament\Pages\Dashboard as BaseDashboard; use Filament\Pages\Dashboard\Concerns\HasFiltersForm; -use Filament\Schemas\Components\Grid; +use Filament\Schemas\Components\Fieldset; use Filament\Schemas\Components\Utilities\Get; use Filament\Schemas\Components\Utilities\Set; use Filament\Schemas\Schema; @@ -50,14 +50,16 @@ class Statistic extends BaseDashboard { return $schema ->components([ - Grid::make([ - 'default' => 2, - 'sm' => 2, - 'md' => 3, - 'lg' => 4, - ])->extraAttributes([ - 'class' => 'bg-gray-100 dark:bg-blue-950 rounded-lg p-5 border border-gray-400 dark:border-blue-800', - ]) + Fieldset::make('Events') + ->dense() + ->columns([ + 'default' => 2, + 'sm' => 2, + 'md' => 3, + 'lg' => 4, + ])->extraAttributes([ + 'class' => 'bg-gray-100 dark:bg-blue-950 rounded-lg p-5 border border-gray-400 dark:border-blue-800', + ]) ->schema([ Select::make('league_id') ->prefixIcon('phosphor-trophy') @@ -153,14 +155,17 @@ class Statistic extends BaseDashboard // ->native(false), ])->columns(6) ->columnSpanFull(), - Grid::make([ - 'default' => 2, - 'sm' => 2, - 'md' => 3, - 'lg' => 4, - ])->extraAttributes([ - 'class' => 'bg-gray-100 dark:bg-blue-950 rounded-lg p-5 border border-gray-400 dark:border-blue-800', - ]) + Fieldset::make('Player') + ->dense() + ->hidden(fn (Get $get) => $get('similar_past_matches') == 'none') + ->columns([ + 'default' => 2, + 'sm' => 2, + 'md' => 3, + 'lg' => 4, + ])->extraAttributes([ + 'class' => 'bg-gray-100 dark:bg-blue-950 rounded-lg p-5 border border-gray-400 dark:border-blue-800', + ]) ->schema([ Select::make('tm_player_id') ->label('Player') diff --git a/app/Filament/Widgets/Data/LoadEvents.php b/app/Filament/Widgets/Data/LoadEvents.php index 360afd45..5578ac71 100644 --- a/app/Filament/Widgets/Data/LoadEvents.php +++ b/app/Filament/Widgets/Data/LoadEvents.php @@ -44,7 +44,7 @@ class LoadEvents if (! $league_id) { return []; } - if (! $team_id) { + if (! $team_id && $similar_past_matches != 'none') { return []; }