Skip to content

Commit

Permalink
Merge pull request #63 from kenepa/61-syntax-error-7-error-syntax-err…
Browse files Browse the repository at this point in the history
…or-at-or-near-group-using-postgresql

Changed searchable array to custom query to resolve the issue with pgsql use of the keyword "group."
  • Loading branch information
Jehizkia authored Oct 16, 2024
2 parents 0e0ba1b + df2c7fc commit eabf533
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/lang/it/translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
'quick-translate-enter' => 'Inserisci la traduzione in ":lang":',
'quick-translate-save-and-continue' => 'Salva e continua',
'quick-translate-nothing' => 'Niente da tradurre!',
];
];
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 eabf533

Please sign in to comment.