Open
Description
Summary of problem or feature request
Non-string values are not searchable for laravel collections in global search.
Code snippet of problem
.../vendor/yajra/laravel-datatables-oracle/src/CollectionDataTable.php
protected function globalSearch(string $keyword): void
...
foreach ($this->request->searchableColumnIndex() as $index) {
$column = $this->getColumnName($index);
$value = Arr::get($data, $column);
if (! is_string($value)) {
continue;
} else {
$value = $this->config->isCaseInsensitive() ? Str::lower($value) : $value;
}
...
}
Due to "continue", we leave the foreach loop and it does all non string values non searchable.
My solution:
if (is_string($value)) {
$value = $this->config->isCaseInsensitive() ? Str::lower($value) : $value;
}
Please help me to unterstand, is this a bug or are non string values not supposed to be searchable?
Thank you!
System details
- Operating System Ubuntu 20.04.5 LTS
- PHP v8.2.3
- Laravel v10.9.0
- Laravel-Datatables v10.4.0