public function apply(Builder $query, string $tableAlias = null, string $customName = null)
    {
        if ($this->hasBeenApplied()) {
            return;
        }

        $name = $this->buildDbName($tableAlias, $customName);

        switch ($this->operation) {
            case '=':
            case '!=':
            case '>':
            case '<':
            case '>=':
            case '<=':
                $query->where($name, $this->operation, $this->value);
                break;
            case 'between':
                $query->whereBetween($name, $this->value);
                break;
            case 'not between':
                $query->whereNotBetween($name, $this->value);
                break;
            case 'in':
                $query->whereIn($name, $this->value);
                break;
            case 'not in':
                $query->whereNotIn($name, $this->value);
                break;
            default:
                throw new InvalidArgumentException('Unsupported operation');
        }
        $this->setApplied(true);
    }