2, 'xl' => 3, ]; public function getHeading(): string|Htmlable|null { return ''; } public function filtersForm(Schema $schema): Schema { 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', ]) ->schema([ Select::make('league_id') ->prefixIcon('phosphor-trophy') ->options(fn () => LoadStatisticFixturesLeaguesOptions::load(1)) ->live() ->label('League') ->afterStateUpdated(function (callable $set) { $set('match_id', null); }), Select::make('match_id') ->prefixIcon('icon-team') ->options(function (Get $get) { return LoadStatisticFixturesMatchOptions::load($get('league_id')); }) ->afterStateUpdated(function (callable $set) { $set('team_id', null); $set('tm_player_id', null); }) ->live() ->label('Events'), Select::make('team_id') ->prefixIcon('icon-team') ->options(function (Get $get) { if ($get('match_id')) { $res = StatisticFixtures::where('id', $get('match_id'))->get(); $arr = []; foreach ($res as $value) { $arr[] = $value->home_id; $arr[] = $value->away_id; } return Element::query()->whereIn('id', $arr)->pluck('name', 'id'); } }) ->afterStateUpdated(function (callable $set) { $set('tm_player_id', null); }) ->live() ->label('Team'), Select::make('team_position') ->prefixIcon('phosphor-map-pin') ->default('all') ->selectablePlaceholder(false) ->options([ 'all' => 'All', 'home' => 'Home', 'away' => 'Away', ]), Select::make('similar_past_matches') ->prefixIcon('phosphor-align-center-horizontal') ->suffixAction( Action::make('iconInfo') ->color('gray') ->icon('phosphor-question') ->tooltip(fn () => $this->tooltip_similar_past_matches()) ) ->default('none') ->live() ->selectablePlaceholder(false) ->options([ 'none' => 'None', 'league' => 'League', 'all' => 'All Database', ]), Slider::make('accuracy') ->hiddenLabel() ->disabled(fn (Get $get) => $get('similar_past_matches') == 'none') ->fillTrack() ->default(5) ->step(0.1) ->decimalPlaces(1) ->tooltips() ->range(minValue: 0, maxValue: 1) ->pips(), // Select::make('accuracy') // ->disabled(fn (Get $get) => $get('similar_past_matches') == 'none') // ->default(0.5) // ->options([ // '0.1' => '0.1', // '0.2' => '0.2', // '0.3' => '0.3', // '0.4' => '0.4', // '0.5' => '0.5', // '0.6' => '0.6', // '0.7' => '0.7', // '0.8' => '0.8', // '0.9' => '0.9', // '1' => '1.0', // ]) // ->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', ]) ->schema([ Select::make('tm_player_id') ->label('Player') ->prefixIcon('icon-player') ->suffixAction( Action::make('copyCostToPrice') ->action(function (callable $set) { $set('tm_player_id', null); $set('player_on_field', null); }) ->color('gray') ->icon('phosphor-x'), ) ->preload() // ->searchable() ->options(function (Get $get) { return StatistikoDetail::where('txodds_id', $get('team_id'))->pluck('name', 'tm_player_id'); }) ->live(), Select::make('player_on_field') ->label('Time on field') ->prefixIcon('phosphor-watch') ->default('all') ->disabled(fn (Get $get) => ! $get('tm_player_id')) ->selectablePlaceholder(false) ->options([ 'all' => 'All', 'lineup' => 'Lineup', 'substituted' => 'Substituted', ]) ->live(), Select::make('statistic_type') ->prefixIcon('phosphor-cell-signal-full') ->default('none') ->selectablePlaceholder(false) ->options([ 'gls' => 'Goals', 'crn' => 'Corner', 'fls' => 'Fouls commited', 'ofs' => 'Offside', 'crd' => 'Cards', 'snt' => 'Shot on target', 'tsh' => 'Total shots', ]), DatePicker::make('start_date') ->native(false) ->prefixIcon('phosphor-calendar') ->live() ->suffixAction( Action::make('clear_start') ->icon('phosphor-x') ->color('gray') ->action(fn (Set $set) => $set('start_date', null)) ), DatePicker::make('end_date') ->native(false) ->prefixIcon('phosphor-calendar') ->live() ->suffixAction( Action::make('clear_end') ->icon('phosphor-x') ->color('gray') ->action(fn (Set $set) => $set('end_date', null)) ), ])->columns(5) ->columnSpanFull(), ]); } public function getFooterWidgetsColumns(): int|array { return [ 'default' => 1, 'sm' => 2, 'lg' => 3, 'xl' => 4, ]; } protected function getFooterWidgets(): array { return [ StatsMedianAverage::make(), ChartPunctualEvent::make(), ChartMovingAverageEvent::make(), ChartPunctualPlayer::make(), ChartMovingAveragePlayer::make(), ]; } protected function tooltip_similar_past_matches(): HtmlString { $str = '