Custom Filter Default

Im using an enum for this filter. The options are working great and filtering correctly, but I cant seem to set a default.
Tables\Filters\Filter::make('property_type')
    ->default(function () use ($rfta) {
        return [
            $rfta->property->type->value,
        ];
    })
    ->form([
        Forms\Components\Section::make('Property Type')
            ->schema([
                Forms\Components\Select::make('type')
                    ->hiddenLabel()
                    ->multiple()
                    ->placeholder('All Property Types')
                    ->options(PropertyType::class),
            ]),
    ])
    ->query(function ($query, $data) {
        return $query->when($data['type'], function ($query, $value) {
            return $query->whereHas('property', function ($query) use ($value) {
                $query->whereIn('type', $value);
            });
        });
    }),
Any advice?
Solution
did you try to set the default value on the select
Was this page helpful?