Filter values keep existing out of nowhere.

I have this dashboard:
class Dashboard extends \Filament\Pages\Dashboard
{
use HasFiltersForm;

public function filtersForm(Form $form): Form
{
return $form
->schema([
Section::make()
->schema([

Toggle::make('custom')->label('Plage de dates personnalisé')->inline(false),
ToggleButtons::make('predefined')
->hiddenLabel(true)
->inline(true)
->hidden(fn (Get $get) => $get('custom'))
->columnSpan(3)
->options(['ytd' => 'Année à ce jour','month' => 'Ce mois','year' => 'Cette année','trimestre' => 'Ce trimestre',]),
DatePicker::make('startDate')
->visible(fn (Get $get) => $get('custom'))
->maxDate(fn (Get $get) => $get('endDate') ?: now())
->native(false),

DatePicker::make('endDate')
->visible(fn (Get $get) => $get('custom'))
->minDate(fn (Get $get) => $get('startDate') ?: now())
->maxDate(now())
->native(false),
// ...
])
->columns(4),
]);
}
}
class Dashboard extends \Filament\Pages\Dashboard
{
use HasFiltersForm;

public function filtersForm(Form $form): Form
{
return $form
->schema([
Section::make()
->schema([

Toggle::make('custom')->label('Plage de dates personnalisé')->inline(false),
ToggleButtons::make('predefined')
->hiddenLabel(true)
->inline(true)
->hidden(fn (Get $get) => $get('custom'))
->columnSpan(3)
->options(['ytd' => 'Année à ce jour','month' => 'Ce mois','year' => 'Cette année','trimestre' => 'Ce trimestre',]),
DatePicker::make('startDate')
->visible(fn (Get $get) => $get('custom'))
->maxDate(fn (Get $get) => $get('endDate') ?: now())
->native(false),

DatePicker::make('endDate')
->visible(fn (Get $get) => $get('custom'))
->minDate(fn (Get $get) => $get('startDate') ?: now())
->maxDate(now())
->native(false),
// ...
])
->columns(4),
]);
}
}
as you can see I have a bunch of filters in my homepage to filter my stats. earlier today I had some other filters to test other things but I have now removed them. yet they still appear in my url when I select filters. see the screenshot for the filters I am talking about. as you can see, type and month exist in my query string but nowhere in my code.
No description
3 Replies
Dennis Koch
Dennis Koch5mo ago
Are they added again when you remove them? They might be saved to the session
King Dice
King DiceOP5mo ago
yes, exactly. I thought of sessions too, but no sessions match their names. maybe encrypted cookies or something I'll delete all storage data and try anyways
Majid Al Zariey
Majid Al Zariey4mo ago
Use this in your page
public function persistsFiltersInSession(): bool
{
return false;
}
public function persistsFiltersInSession(): bool
{
return false;
}
Want results from more Discord servers?
Add your server