{"record":{"id":"67ac4d143af259e3","repo":"z-song/laravel-admin","slug":"class-selectable-must-be-a-sub-class-of-enco-67ac4d","errorCode":null,"errorMessage":"[Class [{$selectable}] must be a sub class of Encore\\Admin\\Grid\\Selectable","messagePattern":"\\[Class \\[(.+?)\\] must be a sub class of Encore\\\\Admin\\\\Grid\\\\Selectable","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Grid/Displayers/BelongsTo.php","lineNumber":40,"sourceCode":"\n    /**\n     * @return mixed\n     */\n    protected function getOriginalData()\n    {\n        return $this->getColumn()->getOriginal();\n    }\n\n    /**\n     * @param string $selectable\n     * @param string $column\n     *\n     * @return string\n     */\n    public function display($selectable = null, $column = '')\n    {\n        if (!class_exists($selectable) || !is_subclass_of($selectable, Selectable::class)) {\n            throw new \\InvalidArgumentException(\n                \"[Class [{$selectable}] must be a sub class of Encore\\Admin\\Grid\\Selectable\"\n            );\n        }\n\n        return Admin::component('admin::grid.inline-edit.belongsto', [\n            'modal'     => sprintf('modal-grid-selector-%s', $this->getClassName()),\n            'key'       => $this->getKey(),\n            'original'  => $this->getOriginalData(),\n            'value'     => $this->getValue(),\n            'resource'  => $this->getResource(),\n            'name'      => $column ?: $this->getName(),\n            'relation'  => get_called_class(),\n            'url'       => $this->getLoadUrl($selectable, get_called_class() == BelongsToMany::class),\n        ]);\n    }\n}\n","sourceCodeStart":22,"sourceCodeEnd":57,"githubUrl":"https://github.com/z-song/laravel-admin/blob/67c441eb78ecc5437e59775d89770cd9c2cb1e05/src/Grid/Displayers/BelongsTo.php#L22-L57","documentation":"Error \"[Class [{$selectable}] must be a sub class of Encore\\Admin\\Grid\\Selectable\" thrown in z-song/laravel-admin.","triggerScenarios":"Thrown at src/Grid/Displayers/BelongsTo.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":"67c441eb78ecc5437e59775d89770cd9c2cb1e05","analyzedAt":"2026-08-21T02:51:03.143Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}