filamentphp/filament · error · LogicException

Is operator can only be used with select constraints.

Error message

Is operator can only be used with select constraints.

What it means

Error "Is operator can only be used with select constraints." thrown in filamentphp/filament.

Source

Thrown at packages/query-builder/src/Constraints/SelectConstraint/Operators/IsOperator.php:147

        // Security: settings arrive from the request payload and can be tampered with. A single
        // select value must be a scalar, and a multiple select value must be a list of scalars;
        // any other shape (e.g. a nested array) would reach `strval()` / `Arr::only()` and throw.
        // Fail closed by discarding non-scalar values.
        if ($isMultiple) {
            return is_array($value)
                ? array_values(array_filter($value, is_scalar(...)))
                : [];
        }

        return is_scalar($value) ? $value : null;
    }

    public function getConstraint(): ?SelectConstraint
    {
        $constraint = parent::getConstraint();

        if (! ($constraint instanceof SelectConstraint)) {
            throw new LogicException('Is operator can only be used with select constraints.');
        }

        return $constraint;
    }
}

View on GitHub (pinned to 53483fa934)

When it happens

Trigger: Thrown at packages/query-builder/src/Constraints/SelectConstraint/Operators/IsOperator.php:147 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of filamentphp/filament@53483fa934 (2026-08-17). Data as JSON: /api/errors/37b4055b332a18bc. Report an issue: GitHub.