Skip to content

Commit 036b302

Browse files
committed
Make uniform
1 parent 5ea420e commit 036b302

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/Traits/WithFilters.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ public function applySearchFilter(Builder $query): Builder
221221
$selectedColumn = ColumnUtilities::mapToSelected($column->column(), $query);
222222

223223
// If the column has a search callback, just use that
224-
if ($column->searchCallback) {
224+
if ($column->hasSearchCallback()) {
225225
// Call the callback
226-
($column->searchCallback)($query, $search);
226+
($column->getSearchCallback())($query, $search);
227227
} elseif (! $hasRelation || $selectedColumn) { // If the column isn't a relation or if it was previously selected
228228
$whereColumn = $selectedColumn ?? $column->column();
229229

src/Views/Column.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,4 +246,20 @@ public function getSortCallback(): ?callable
246246
{
247247
return $this->sortCallback;
248248
}
249+
250+
/**
251+
* @return bool
252+
*/
253+
public function hasSearchCallback(): bool
254+
{
255+
return $this->searchCallback !== null;
256+
}
257+
258+
/**
259+
* @return callable|null
260+
*/
261+
public function getSearchCallback(): ?callable
262+
{
263+
return $this->searchCallback;
264+
}
249265
}

0 commit comments

Comments
 (0)