{"record":{"id":"51f5ebe4cb7d1da2","repo":"filamentphp/filament","slug":"import-column-of-class-importcolumnclass-must-h","errorCode":null,"errorMessage":"Import column of class [$importColumnClass] must have a unique name, passed to the [make()] method.","messagePattern":"Import column of class \\[\\$importColumnClass\\] must have a unique name, passed to the \\[make\\(\\)\\] method\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"packages/actions/src/Imports/ImportColumn.php","lineNumber":101,"sourceCode":"    protected string $evaluationIdentifier = 'column';\n\n    protected string | Htmlable | Closure | null $helperText = null;\n\n    protected bool | Closure $isSensitive = false;\n\n    final public function __construct(string $name)\n    {\n        $this->name($name);\n    }\n\n    public static function make(?string $name = null): static\n    {\n        $importColumnClass = static::class;\n\n        $name ??= static::getDefaultName();\n\n        if (blank($name)) {\n            throw new InvalidArgumentException(\"Import column of class [$importColumnClass] must have a unique name, passed to the [make()] method.\");\n        }\n\n        $static = app($importColumnClass, ['name' => $name]);\n        $static->configure();\n\n        return $static;\n    }\n\n    public static function getDefaultName(): ?string\n    {\n        return null;\n    }\n\n    public function getSelect(): Select\n    {\n        return Select::make($this->getName())\n            ->label($this->getLabel())\n            ->placeholder(__('filament-actions::import.modal.form.columns.placeholder'))","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/filamentphp/filament/blob/53483fa9340e4ec637985fe454ebb58afb92ea24/packages/actions/src/Imports/ImportColumn.php#L83-L119","documentation":"Every Filament import column needs a unique name that maps it to a CSV header and to the importer property it fills. `ImportColumn::make()` falls back to `getDefaultName()`, which returns `null` on the base class, so a blank or missing name fails fast with an InvalidArgumentException before any configuration runs. The check uses `blank()`, so `null`, `''`, and whitespace-only strings all trigger it.","triggerScenarios":"`ImportColumn::make()` with no argument in a class that does not override `getDefaultName()`, or `ImportColumn::make($header)` where `$header` is null or an empty/whitespace string when the schema is built.","commonSituations":"Generating importer schemas dynamically from uploaded CSV headers, looping over a config array where a key is missing, or copy-pasting a column definition and deleting the name.","solutions":["Pass an explicit, unique name: `ImportColumn::make('email')`.","When generating columns from dynamic data, default the value: `ImportColumn::make($header ?? 'column_' . $index)`.","In reusable custom column classes, override `getDefaultName()` to return a non-blank default."],"exampleFix":"// before\nImportColumn::make()\n    ->numeric(),\n\n// after\nImportColumn::make('email')\n    ->required(),","handlingStrategy":"type-guard","validationCode":"foreach ($headers as $index => $header) {\n    if (blank($header)) {\n        continue; // or throw with $index context\n    }\n\n    $columns[] = ImportColumn::make($header);\n}","typeGuard":"function assertImportColumnName(?string $name): string\n{\n    if (blank($name)) {\n        throw new InvalidArgumentException('Import column name required, got: ' . var_export($name, true));\n    }\n\n    return $name;\n}\n\n// ImportColumn::make(assertImportColumnName($header))","tryCatchPattern":null,"preventionTips":["Treat a null column name from dynamic data as a data error and skip/log it early.","Override getDefaultName() in custom column classes that always have a known name.","Never chain ->make() off copy-pasted definitions without checking the argument survived."],"tags":["filament","imports","schema","component-name","invalid-argument"],"backgroundTag":"missing-component-name","analyzedSha":"53483fa9340e4ec637985fe454ebb58afb92ea24","analyzedAt":"2026-08-17T02:06:23.049Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}