how to hide other field in select table filter according to another filter

Filter::make('within_h') ->label('H-Tempo') ->schema(function ($livewire) { return [ \Filament\Forms\Components\Select::make('range') ->label('Tempo') ->options([ 7 => '7 Hari', 30 => '30 Hari' ]), \Filament\Forms\Components\TextInput::make('custom') ->label('Custom') ->visible(fn () // todo) ->numeric() ->minValue(1), ]; }) ->query(function (Builder $query, array $data) { if (blank($data['range'])) { return; } $query->withinH($data['range']); }),
1 Reply
Rolland
Rolland3mo ago
Example:
->visible(fn (Forms\Get $get) => $get('range') ? false : true)
->visible(fn (Forms\Get $get) => $get('range') ? false : true)

Did you find this page helpful?