protected function createSearchRangeClause(Builder $query, $value, array $columns)
    {
        // Skip arrays
        if (is_array($value) === true) {
            return false;
        }

        // Get the range type
        $range_type = strtolower(substr($value, 0, 2));

        // Perform a range based query if the range is valid
        // and the separator matches.
        if (substr($value, 2, 1) === ':' && in_array($range_type, $this->range_keys)) {
            // Get the true value
            $value = substr($value, 3);

            switch ($range_type) {
                case 'gt':
                    $query->where($this->appendTableName($columns[0]), '>', $value, 'and');
                    break;
                case 'lt':
                    $query->where($this->appendTableName($columns[0]), '<', $value, 'and');
                    break;
                case 'ne':
                    $query->where($this->appendTableName($columns[0]), '<>', $value, 'and');
                    break;
                case 'bt':
                    // Because this can only have two values
                    if (count($values = explode(',', $value)) === 2) {
                        $query->whereBetween($this->appendTableName($columns[0]), $values);
                    }
                    break;
            }

            return true;
        }

        return false;
    }
protected function createSearchRangeClause(Builder $query, $value, array $columns)
    {
        // Skip arrays
        if (is_array($value) === true) {
            return false;
        }

        // Get the range type
        $range_type = strtolower(substr($value, 0, 2));

        // Perform a range based query if the range is valid
        // and the separator matches.
        if (substr($value, 2, 1) === ':' && in_array($range_type, $this->range_keys)) {
            // Get the true value
            $value = substr($value, 3);

            switch ($range_type) {
                case 'gt':
                    $query->where($this->appendTableName($columns[0]), '>', $value, 'and');
                    break;
                case 'lt':
                    $query->where($this->appendTableName($columns[0]), '<', $value, 'and');
                    break;
                case 'ne':
                    $query->where($this->appendTableName($columns[0]), '<>', $value, 'and');
                    break;
                case 'bt':
                    // Because this can only have two values
                    if (count($values = explode(',', $value)) === 2) {
                        $query->whereBetween($this->appendTableName($columns[0]), $values);
                    }
                    break;
            }

            return true;
        }

        return false;
    }
protected function createSearchRangeClause ( Builder $ query , $ value , array $ columns ) { // Skip arrays if ( is_array ( $ value ) === true ) { return false ; } // Get the range type $ range_type = strtolower ( substr ( $ value , 0 , 2 ) ) ; // Perform a range based query if the range is valid // and the separator matches. if ( substr ( $ value , 2 , 1 ) === ':' && in_array ( $ range_type , $ this -> range_keys ) ) { // Get the true value $ value = substr ( $ value , 3 ) ; switch ( $ range_type ) { case 'gt' : $ query -> where ( $ this -> appendTableName ( $ columns [ 0 ] ) , '>' , $ value , 'and' ) ; break ; case 'lt' : $ query -> where ( $ this -> appendTableName ( $ columns [ 0 ] ) , '<' , $ value , 'and' ) ; break ; case 'ne' : $ query -> where ( $ this -> appendTableName ( $ columns [ 0 ] ) , '<>' , $ value , 'and' ) ; break ; case 'bt' : // Because this can only have two values if ( count ( $ values = explode ( ',' , $ value ) ) === 2 ) { $ query -> whereBetween ( $ this -> appendTableName ( $ columns [ 0 ] ) , $ values ) ; } break ; } return true ; } return false ; }
Add a range clause to the query.

@param Builder $query
@param string  $value
@param array   $columns

@return bool
Add a range clause to the query .