app/Services/SearchService.php
private function whereSearch(Builder $query, $field, array $search_terms): void
    {
        if ($field instanceof Expression) {
            $field = $field->getValue();
        }

        foreach ($search_terms as $search_term) {
            $query->whereContains(DB::raw($field), $search_term);
        }
    }
private function whereSearch(Builder $query, $field, array $search_terms): void
    {
        if ($field instanceof Expression) {
            $field = $field->getValue();
        }

        foreach ($search_terms as $search_term) {
            $query->whereContains(DB::raw($field), $search_term);
        }
    }
private function whereSearch ( Builder $ query , $ field , array $ search_terms ) : void { if ( $ field instanceof Expression ) { $ field = $ field -> getValue ( ) ; } foreach ( $ search_terms as $ search_term ) { $ query -> whereContains ( DB :: raw ( $ field ) , $ search_term ) ; } }
Apply search filters to a SQL query column.  Apply collation rules to MySQL.

@param Builder           $query
@param Expression|string $field
@param string[]          $search_terms
Apply search filters to a SQL query column . Apply collation rules to MySQL .