> For the complete documentation index, see [llms.txt](https://boredprogrammers.gitbook.io/laragrid/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://boredprogrammers.gitbook.io/laragrid/filter/usage.md).

# Usage

Filters are used in the `getColumns` method of your Livewire component to define the filters for the columns in the grid. The filters are applied to the data source based on the user's input.

```php
protected function getColumns(): array
{
    return [
        Column::make('id', 'ID'),
        Column::make('name', 'Name')->setFilter(TextFilter::make()),
        Column::make('status', 'Status')->setFilter(SelectFilter::make()->setOptions([
            'active' => 'Active',
            'inactive' => 'Inactive',
        ])),
        Column::make('created_at', 'Created At')->setFilter(DateFilter::make()),
        // Add more columns as needed
    ];
}
```
