public function search($searchStr)
    {
        $conditions = [];

        $parsedStr = $this->parseSearchStr($searchStr);

        foreach ($this->searchable() as $column) {
            $conditions[] = $column.' like "'.$parsedStr.'"';
        }

        $method = $this->searchOperator.'Raw';
        $query  = $this->query()->{$method}('('.join(' OR ', $conditions).')');

        if ($this->sort) {
            $this->applySort($query, $searchStr);
        }

        return $query;
    }
public function search($searchStr)
    {
        $conditions = [];

        $parsedStr = $this->parseSearchStr($searchStr);

        foreach ($this->searchable() as $column) {
            $conditions[] = $column.' like "'.$parsedStr.'"';
        }

        $method = $this->searchOperator.'Raw';
        $query  = $this->query()->{$method}('('.join(' OR ', $conditions).')');

        if ($this->sort) {
            $this->applySort($query, $searchStr);
        }

        return $query;
    }
public function search ( $ searchStr ) { $ conditions = [ ] ; $ parsedStr = $ this -> parseSearchStr ( $ searchStr ) ; foreach ( $ this -> searchable ( ) as $ column ) { $ conditions [ ] = $ column . ' like "' . $ parsedStr . '"' ; } $ method = $ this -> searchOperator . 'Raw' ; $ query = $ this -> query ( ) -> { $ method } ( '(' . join ( ' OR ' , $ conditions ) . ')' ) ; if ( $ this -> sort ) { $ this -> applySort ( $ query , $ searchStr ) ; } return $ query ; }
Apply search query.

@param  string|mixed  $searchStr
@return \Illuminate\Database\Eloquent\Builder
Apply search query .