{"record":{"id":"b02a66f26d67b20b","repo":"z-song/laravel-admin","slug":"column-of-this-field-must-be-a-belongstomany-or","errorCode":null,"errorMessage":"Column of this field must be a `BelongsToMany` or `HasMany` relation.","messagePattern":"Column of this field must be a `BelongsToMany` or `HasMany` relation\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/Form/Field/MultipleSelect.php","lineNumber":47,"sourceCode":"            return $this->otherKey;\n        }\n\n        if (is_callable([$this->form->model(), $this->column])) {\n            $relation = $this->form->model()->{$this->column}();\n\n            if ($relation instanceof BelongsToMany) {\n                /* @var BelongsToMany $relation */\n                $fullKey = $relation->getQualifiedRelatedPivotKeyName();\n                $fullKeyArray = explode('.', $fullKey);\n\n                return $this->otherKey = 'pivot.'.end($fullKeyArray);\n            } elseif ($relation instanceof HasManyRelation) {\n                /* @var HasManyRelation $relation */\n                return $this->otherKey = $relation->getRelated()->getKeyName();\n            }\n        }\n\n        throw new \\Exception('Column of this field must be a `BelongsToMany` or `HasMany` relation.');\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function fill($data)\n    {\n        if ($this->form && $this->form->shouldSnakeAttributes()) {\n            $key = Str::snake($this->column);\n        } else {\n            $key = $this->column;\n        }\n\n        $relations = Arr::get($data, $key);\n\n        if (is_string($relations)) {\n            $this->value = explode(',', $relations);\n        }","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/z-song/laravel-admin/blob/67c441eb78ecc5437e59775d89770cd9c2cb1e05/src/Form/Field/MultipleSelect.php#L29-L65","documentation":"Error \"Column of this field must be a `BelongsToMany` or `HasMany` relation.\" thrown in z-song/laravel-admin.","triggerScenarios":"Thrown at src/Form/Field/MultipleSelect.php:47 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":"67c441eb78ecc5437e59775d89770cd9c2cb1e05","analyzedAt":"2026-08-21T02:51:03.143Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}