src/SearchableTrait.php
protected function getSearchQuery(Builder $query, $column, $relevance, array $words, $relevance_multiplier, $pre_word = '', $post_word = '')
    {
        $like_comparator = $this->getDatabaseDriver() == 'pgsql' ? 'ILIKE' : 'LIKE';
        $cases = [];

        foreach ($words as $word)
        {
            $cases[] = $this->getCaseCompare($column, $like_comparator, $relevance * $relevance_multiplier);
            $this->search_bindings[] = $pre_word . $word . $post_word;
        }

        return implode(' + ', $cases);
    }
protected function getSearchQuery(Builder $query, $column, $relevance, array $words, $relevance_multiplier, $pre_word = '', $post_word = '')
    {
        $like_comparator = $this->getDatabaseDriver() == 'pgsql' ? 'ILIKE' : 'LIKE';
        $cases = [];

        foreach ($words as $word)
        {
            $cases[] = $this->getCaseCompare($column, $like_comparator, $relevance * $relevance_multiplier);
            $this->search_bindings[] = $pre_word . $word . $post_word;
        }

        return implode(' + ', $cases);
    }
protected function getSearchQuery ( Builder $ query , $ column , $ relevance , array $ words , $ relevance_multiplier , $ pre_word = '' , $ post_word = '' ) { $ like_comparator = $ this -> getDatabaseDriver ( ) == 'pgsql' ? 'ILIKE' : 'LIKE' ; $ cases = [ ] ; foreach ( $ words as $ word ) { $ cases [ ] = $ this -> getCaseCompare ( $ column , $ like_comparator , $ relevance * $ relevance_multiplier ) ; $ this -> search_bindings [ ] = $ pre_word . $ word . $ post_word ; } return implode ( ' + ' , $ cases ) ; }
Returns the sql string for the given parameters.

@param \Illuminate\Database\Eloquent\Builder $query
@param string $column
@param string $relevance
@param array $words
@param string $compare
@param float $relevance_multiplier
@param string $pre_word
@param string $post_word
@return string
Returns the sql string for the given parameters .