filamentphp/filament · error · LogicException

Is operator can only be used with relationship constraints.

Error message

Is operator can only be used with relationship constraints.

What it means

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

Source

Thrown at packages/query-builder/src/Constraints/RelationshipConstraint/Operators/IsRelatedToOperator.php:232

        // `multiple()`, but any other shape (e.g. a nested array) would reach `whereKey()`
        // binding and crash the request. Fail closed by discarding non-scalar values.
        if (is_array($value)) {
            return array_values(array_filter($value, is_scalar(...)));
        }

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

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

        if (! $constraint) {
            return null;
        }

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

        return $constraint;
    }

    public function forceSearchCaseInsensitive(bool | Closure | null $condition = true): static
    {
        $this->isSearchForcedCaseInsensitive = $condition;

        return $this;
    }

    public function isSearchForcedCaseInsensitive(): ?bool
    {
        return $this->evaluate($this->isSearchForcedCaseInsensitive);
    }

    public function getModifyRelationshipQueryUsing(): ?Closure

View on GitHub (pinned to 53483fa934)

When it happens

Trigger: Thrown at packages/query-builder/src/Constraints/RelationshipConstraint/Operators/IsRelatedToOperator.php:232 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/afb396a0711becf4. Report an issue: GitHub.