Quick filters
Allows you to add search input or select with preseted filters at the list view
Setup
First, install the plugin:
pnpm i @adminforth/quick-filters
Then add it to yours resource:
./resources/apartments.ts
import QuickFiltersPlugin from '@adminforth/quick-filters';
And finally add it to list of plugins:
./resources/apartments.ts
plugins: [
...
new QuickFiltersPlugin({
filters: [
{
name: 'Listed',
enum: [
{ label: 'Listed', filters: () => Filters.EQ('listed', true) },
{ label: 'Not listed', filters: () => Filters.EQ('listed', false) },
]
},
{
name: 'Title',
searchInput: (searchVal) => Filters.ILIKE('title', searchVal)
},
]
}),
...
]
