original_string: 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);
          }
      }
code: 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);
          }
      }
code_tokens: 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 ) ; } }
docstring: Applies the search constraint to a query.
docstring_tokens: Applies the search constraint to a query .