Hi,
I need to modify how SEARCH works, so that it will search more loosely.
So in the following code (in executes method of SQLHandler class), I need to add two additional orWhereRaw calls, as such:
if($this->search()!==null) {
$search = $this->search();
$query->where(function ($query) use ($search) {
foreach($search["fields"] as $field) {
$query->orWhereRaw('REPLACE('.$field.', " ", "") LIKE "%'.$search["text"].'%" ');
$query->orWhereRaw($field.' LIKE "%'.str_replace(" ", "", $search["text"]).'%" ');
$query->orWhere($field,"LIKE","%".$search['text']."%");
}
});
}
So question is: how can I do that (without modifying vendor src class), or if there is maybe a better alternative to achieve the same result?
Thank you, Jernej