You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-3Lines changed: 12 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,9 +66,11 @@ class Table extends DataTableComponent
66
66
{
67
67
return [
68
68
Column::make('Type')
69
-
->sortable(),
69
+
->sortable()
70
+
->searchable(),
70
71
Column::make('Name')
71
-
->sortable(),
72
+
->sortable()
73
+
->searchable(),
72
74
Column::make('Permissions'),
73
75
Column::blank(),
74
76
];
@@ -345,7 +347,14 @@ public array $filterNames = [
345
347
346
348
### Adding Search
347
349
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.
0 commit comments