filamentphp/filament · error · LogicException

The [{$column->getName()}] column must be an IconColumn to s

Error message

The [{$column->getName()}] column must be an IconColumn to show an icon count summary.

What it means

Error "The [{$column->getName()}] column must be an IconColumn to show an icon count summary." thrown in filamentphp/filament.

Source

Thrown at packages/tables/src/Columns/Summarizers/Count.php:40

    {
        parent::setUp();

        $this->numeric();
    }

    /**
     * @return int | float | array<string, array<string, int>> | null
     */
    public function summarize(Builder $query, string $attribute): int | float | array | null
    {
        if (! $this->hasIcons) {
            return $query->count();
        }

        $column = $this->getColumn();

        if (! ($column instanceof IconColumn)) {
            throw new LogicException("The [{$column->getName()}] column must be an IconColumn to show an icon count summary.");
        }

        $state = [];

        foreach ($query->clone()->distinct()->pluck($attribute) as $value) {
            $column->record($this->getQuery()->getModel()->setKeyName($attribute)->setAttribute($attribute, $value));
            $column->clearCachedState();
            $columnState = $column->getState();
            $column->clearCachedState();
            $color = json_encode($column->getColor($columnState));
            $icon = $column->getIcon($columnState);
            $iconKey = serialize($icon);

            $state[$color] ??= [];
            $state[$color][$iconKey] ??= 0;

            $state[$color][$iconKey] += $query->clone()->where($attribute, $value)->count();
        }

View on GitHub (pinned to 53483fa934)

When it happens

Trigger: Thrown at packages/tables/src/Columns/Summarizers/Count.php:40 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/b047c20166e9707d. Report an issue: GitHub.