Skip to content

Commit

Permalink
CChanged searchable array to custom query to resolve the issue with p…
Browse files Browse the repository at this point in the history
…gsql use of the keyword "group."
  • Loading branch information
Jehizkia committed Oct 16, 2024
1 parent 0e0ba1b commit d7205c8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Resources/LanguageLineResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ public static function getColumns(): array
$columns = [
TextColumn::make('group_and_key')
->label(__('translation-manager::translations.group') . ' & ' . __('translation-manager::translations.key'))
->searchable(['group', 'key'])
->searchable(query: function (Builder $query, string $search): Builder {
return $query
->where('group', 'like', "%{$search}%")
->orWhere('key', 'like', "%{$search}%");
})
->getStateUsing(function (Model $record) {
return $record->group . '.' . $record->key;
}),
Expand Down

0 comments on commit d7205c8

Please sign in to comment.