Skip to content

Commit 01e23c1

Browse files
committed
Improve page table search
1 parent fd81a09 commit 01e23c1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Resources/PageResource.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,12 @@ public static function table(Table $table): Table
188188
return $table
189189
->columns([
190190
TitleColumn::create()
191-
->searchable(query: function ($query, $search) {
191+
->searchable(query: function ($query, $search, $livewire) {
192192
$locale = app()->getLocale();
193+
if (method_exists($livewire, 'getActiveFormsLocale')) {
194+
$locale = $livewire->getActiveFormsLocale();
195+
}
196+
193197
$search = strtolower($search);
194198

195199
return $query->whereRaw("LOWER(title->>'$.{$locale}') LIKE ?", ["%{$search}%"]);

0 commit comments

Comments
 (0)