Skip to content

Commit 00c65ce

Browse files
authored
fix using DB::raw() statements in the query() function of the Table
- this should fix the error "str_ends_with(): Argument rappasoft#1 ($haystack) must be of type string, Illuminate\Database\Query\Expression given"
1 parent ec2b11f commit 00c65ce

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Utilities/ColumnUtilities.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ public static function hasMatch($column, $searchColumns): bool
6868
public static function hasWildcardMatch($column, $searchColumns): bool
6969
{
7070
return count(array_filter($searchColumns ?? [], function ($searchColumn) use ($column) {
71+
72+
// filter the `DB::raw()`-expressions
73+
if (gettype($searchColumn) !== 'string') {
74+
return false;
75+
}
76+
7177
// Match wildcards such as * or table.*
7278
$hasWildcard = Str::endsWith($searchColumn, '*');
7379

0 commit comments

Comments
 (0)