{"record":{"id":"b047c20166e9707d","repo":"filamentphp/filament","slug":"the-column-getname-column-must-be-an-iconc","errorCode":null,"errorMessage":"The [{$column->getName()}] column must be an IconColumn to show an icon count summary.","messagePattern":"The \\[(.+?)\\] column must be an IconColumn to show an icon count summary\\.","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"packages/tables/src/Columns/Summarizers/Count.php","lineNumber":40,"sourceCode":"    {\n        parent::setUp();\n\n        $this->numeric();\n    }\n\n    /**\n     * @return int | float | array<string, array<string, int>> | null\n     */\n    public function summarize(Builder $query, string $attribute): int | float | array | null\n    {\n        if (! $this->hasIcons) {\n            return $query->count();\n        }\n\n        $column = $this->getColumn();\n\n        if (! ($column instanceof IconColumn)) {\n            throw new LogicException(\"The [{$column->getName()}] column must be an IconColumn to show an icon count summary.\");\n        }\n\n        $state = [];\n\n        foreach ($query->clone()->distinct()->pluck($attribute) as $value) {\n            $column->record($this->getQuery()->getModel()->setKeyName($attribute)->setAttribute($attribute, $value));\n            $column->clearCachedState();\n            $columnState = $column->getState();\n            $column->clearCachedState();\n            $color = json_encode($column->getColor($columnState));\n            $icon = $column->getIcon($columnState);\n            $iconKey = serialize($icon);\n\n            $state[$color] ??= [];\n            $state[$color][$iconKey] ??= 0;\n\n            $state[$color][$iconKey] += $query->clone()->where($attribute, $value)->count();\n        }","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/filamentphp/filament/blob/53483fa9340e4ec637985fe454ebb58afb92ea24/packages/tables/src/Columns/Summarizers/Count.php#L22-L58","documentation":"Error \"The [{$column->getName()}] column must be an IconColumn to show an icon count summary.\" thrown in filamentphp/filament.","triggerScenarios":"Thrown at packages/tables/src/Columns/Summarizers/Count.php:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"53483fa9340e4ec637985fe454ebb58afb92ea24","analyzedAt":"2026-08-17T02:06:23.049Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}