protected function applySearchToQuery($query, $columns, $boolean = 'and')
    {
        $term = $this->searchTerm;

        if ($scopeMethod = $this->searchScope) {
            $searchMethod = $boolean == 'and' ? 'where' : 'orWhere';
            $query->$searchMethod(function ($q) use ($term, $columns, $scopeMethod) {
                $q->$scopeMethod($term, $columns);
            });
        }
        else {
            $searchMethod = $boolean == 'and' ? 'searchWhere' : 'orSearchWhere';
            $query->$searchMethod($term, $columns, $this->searchMode);
        }
    }
protected function applySearchToQuery($query, $columns, $boolean = 'and')
    {
        $term = $this->searchTerm;

        if ($scopeMethod = $this->searchScope) {
            $searchMethod = $boolean == 'and' ? 'where' : 'orWhere';
            $query->$searchMethod(function ($q) use ($term, $columns, $scopeMethod) {
                $q->$scopeMethod($term, $columns);
            });
        }
        else {
            $searchMethod = $boolean == 'and' ? 'searchWhere' : 'orSearchWhere';
            $query->$searchMethod($term, $columns, $this->searchMode);
        }
    }
protected function applySearchToQuery ( $ query , $ columns , $ boolean = 'and' ) { $ term = $ this -> searchTerm ; if ( $ scopeMethod = $ this -> searchScope ) { $ searchMethod = $ boolean == 'and' ? 'where' : 'orWhere' ; $ query -> $ searchMethod ( function ( $ q ) use ( $ term , $ columns , $ scopeMethod ) { $ q -> $ scopeMethod ( $ term , $ columns ) ; } ) ; } else { $ searchMethod = $ boolean == 'and' ? 'searchWhere' : 'orSearchWhere' ; $ query -> $ searchMethod ( $ term , $ columns , $ this -> searchMode ) ; } }
Applies the search constraint to a query.
Applies the search constraint to a query .