2, 'xl' => 3, ]; public function getActiveTab() { return $this->activeTab; } public function getHeading(): string|Htmlable|null { return ''; } public function updatedFilter($value) // Or whatever your property name is { $this->dispatch('filterChanged', filterValue: $value); } // protected function getHeaderActions(): array // { // return [ // Action::make('collapseAll') // ->label('Collapse All Charts') // ->icon('heroicon-m-chevron-up') // ->color('gray') // ->action(function ($record, $livewire) { // $livewire->dispatch('collapse-all-charts'); // }), // ]; // } public function filtersForm(Schema $schema): Schema { return $schema ->components([ Grid::make([ 'default' => 1, 'sm' => 2, 'md' => 4, ]) ->columnSpanFull() ->extraAttributes([ 'class' => 'p-5 bg-blue-50 dark:bg-blue-950 rounded-lg border border-blue-200 dark:border-blue-800', ]) ->schema([ Select::make('league_id') // ->prefixIconColor('primary') ->prefixIconColor(fn (Get $get): string => $get('league_id') ? 'success' : 'danger') ->prefixIcon('phosphor-trophy') ->hiddenLabel() ->options(fn () => LoadStatisticFixturesLeaguesOptions::load(1)) ->live() ->placeholder('League') ->afterStateUpdated(function (callable $set, $state) { $set('match_id', null); $set('team_id', null); $set('tm_player_id', null); $this->dispatch('filterChanged', filterValue: $state); }), Select::make('match_id') ->hiddenLabel() ->prefixIconColor(fn (Get $get): string => $get('match_id') ? 'success' : 'danger') ->prefixIcon('phosphor-calendar-check') ->options(function (Get $get) { return LoadStatisticFixturesMatchOptions::load($get('league_id')); }) ->afterStateUpdated(function (callable $set) { $set('team_id', null); $set('tm_player_id', null); }) ->live() ->placeholder('Events'), Select::make('team_id') ->hiddenLabel() ->prefixIconColor(function (Get $get): string { if ($get('team_id')) { return 'success'; } elseif ($get('similar_past_matches') != 'none') { return 'gray'; } else { return 'danger'; } }) // ->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'primary' : '') // ->hidden(fn (Get $get) => $get('similar_past_matches') != 'none') ->prefixIcon('phosphor-users-three') ->disabled(fn (Get $get) => $get('similar_past_matches') != 'none') ->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() ->placeholder('Team'), Select::make('team_position') ->hiddenLabel() ->placeholder('Team Position') ->prefix('Team Position') // ->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'primary' : '') ->prefixIcon('phosphor-map-pin') ->disabled(fn (Get $get) => $get('similar_past_matches') != 'none') ->default('all') ->selectablePlaceholder(false) ->options([ 'all' => 'All', 'home' => 'Home', 'away' => 'Away', ]), DatePicker::make('start_date') ->hiddenLabel() ->native(false) ->prefixIconColor('primary') ->prefixIcon('phosphor-calendar') ->live() ->prefix('Start') ->suffixAction( Action::make('clear_start') ->icon('phosphor-x') ->color('gray') ->action(fn (Set $set) => $set('start_date', null)) ), DatePicker::make('end_date') ->hiddenLabel() ->native(false) ->prefixIconColor('primary') ->prefixIcon('phosphor-calendar') ->live() ->prefix('End') ->suffixAction( Action::make('clear_end') ->icon('phosphor-x') ->color('gray') ->action(fn (Set $set) => $set('end_date', null)) ), Select::make('statistic_type') ->hiddenLabel() ->placeholder('Statistic Type') ->prefixIconColor('success') ->prefixIcon('phosphor-arrows-out-line-vertical') ->default('none') ->selectablePlaceholder(false) ->options([ 'gls' => 'Goals', 'crn' => 'Corner', 'fls' => 'Fouls Commited', 'ofs' => 'Offside', 'crd' => 'Cards', 'snt' => 'Shots On Target', 'tsh' => 'Total shots', ]), Select::make('similar_past_matches') ->hiddenLabel() ->placeholder('Similar Past Matches') ->prefixIconColor('primary') ->suffix(fn (Get $get): string|HtmlString => $get('similar_past_matches') != 'none' ? new HtmlString('