default select on relationship

Hello, i would like put a default value for my filter select but that didn"t works :

SelectFilter::make('exercice')
                    ->label('Exercice')
                    ->relationship('exercice', 'name', fn($query) => $query->orderBy('id', 'desc') )
                    ->default(2022)
                    ->searchable()
                    ->multiple()
                    ->preload(),


The table Exercice looks like :
image.png
Solution
It is multiple, try:

->default([1])
Was this page helpful?