F
Filament11mo ago
dipu

i want to search case-sensitivity column search

TextColumn::make('contact.firstName')->searchable()->weight('bold')->grow(false), this line show error is
'''Illuminate  \  Database  \  QueryException PHP 8.1.2-1ubuntu2.14 10.33.0 SQLSTATE[42703]: Undefined column: 7 ERROR: column "firstname" does not exist LINE 1: ...ontactId" = "contacts"."mfm_contact_id" and lower(firstName:... ^ HINT: Perhaps you meant to reference the column "contacts.firstName". SELECT count(*) AS aggregate FROM "conversations" WHERE ( EXISTS ( SELECT * FROM "contacts" WHERE "conversations"."contactId" = "contacts"."mfm_contact_id" AND lower(firstName:: text):: text LIKE % sa % AND "contacts"."deleted_at" IS NULL ) )''' query autometically lower table column name
4 Replies
Subhrajita
Subhrajita10mo ago
I have a similar issue.. TextColumn::make('firstName') ->searchable() ->forceSearchCaseInsensitive(false) after using forceSearchCaseInsensitive as false, I am having this issue.
No description
LeandroFerreira
LeandroFerreira10mo ago
TextColumn::make('firstName')
->searchable(query: function (Builder $query, string $search): Builder {
return $query
->where('firstName', 'like', "%{$search}%");
})
TextColumn::make('firstName')
->searchable(query: function (Builder $query, string $search): Builder {
return $query
->where('firstName', 'like', "%{$search}%");
})
?
Subhrajita
Subhrajita10mo ago
Yes, it is working, thank you.
LeandroFerreira
LeandroFerreira10mo ago
@dipu 👆
Want results from more Discord servers?
Add your server