Skip to content

Commit 8094075

Browse files
committed
updating docs
1 parent cf78a25 commit 8094075

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,11 @@ class Table extends DataTableComponent
6666
{
6767
return [
6868
Column::make('Type')
69-
->sortable(),
69+
->sortable()
70+
->searchable(),
7071
Column::make('Name')
71-
->sortable(),
72+
->sortable()
73+
->searchable(),
7274
Column::make('Permissions'),
7375
Column::blank(),
7476
];
@@ -345,7 +347,14 @@ public array $filterNames = [
345347

346348
### Adding Search
347349

348-
The search is a special built-in filter that is managed by the component, but you need to define the search query, you can do so the same as any other filter:
350+
The search is a special built-in filter that is managed by the component, but you need to define the behavior. For a simple default search behavior, add searchable() to columns:
351+
352+
```php
353+
Column::make('Type')
354+
->searchable()
355+
```
356+
357+
Sometimes the default search behavior may not meet your requirements. If this is the case, skip using the searchable() method on columns and define your own behavior directly on the query.
349358

350359
```php
351360
public function query(): Builder

0 commit comments

Comments
 (0)