Skip to content

Commit

Permalink
Merge pull request #15024 from noahlocke/patch-1
Browse files Browse the repository at this point in the history
Update 02-select.md
  • Loading branch information
danharrin authored Dec 9, 2024
2 parents 81b06a6 + 260102e commit b6d37b0
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions packages/tables/docs/04-filters/02-select.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,29 @@ SelectFilter::make('status')
->default('draft')
->selectablePlaceholder(false)
```

## Applying select filters by default

You may set a select filter to be enabled by default, using the `default()` method. If using a single select filter, the `default()` method accepts a single option value. If using a `multiple()` select filter, the `default()` method accepts an array of option values:

```php
use Filament\Tables\Filters\SelectFilter;

SelectFilter::make('status')
->options([
'draft' => 'Draft',
'reviewing' => 'Reviewing',
'published' => 'Published',
])
->default('draft')

SelectFilter::make('status')
->options([
'draft' => 'Draft',
'reviewing' => 'Reviewing',
'published' => 'Published',
])
->multiple()
->default(['draft', 'reviewing'])
```

0 comments on commit b6d37b0

Please sign in to comment.