Skip to content

Commit 4dd6be3

Browse files
committed
Merge branch 'feature-searchable' of https://github.com/DeltaSystems/laravel-livewire-tables into feature-searchable
2 parents 8094075 + 49c3b02 commit 4dd6be3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Traits/WithFilters.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,17 +234,15 @@ public function applySearchFilter(Builder $query): Builder
234234

235235
// if the column isn't a relation or if it was previously selected
236236
} elseif (! $hasRelation || $selectedColumn) {
237-
238237
$whereColumn = $selectedColumn ?? $column->column();
239238

240239
// @todo: skip aggregates
241-
if (!$hasRelation && $query instanceof Builder) {
240+
if (! $hasRelation && $query instanceof Builder) {
242241
$whereColumn = $query->getModel()->getTable() . '.' . $whereColumn;
243242
}
244243

245244
// we can use a simple where clause
246245
$subQuery->orWhere($whereColumn, 'like', '%' . $search . '%');
247-
248246
} else {
249247

250248
// parse the column

0 commit comments

Comments
 (0)