{"record":{"id":"124611bb69f710ab","repo":"z-song/laravel-admin","slug":"invalid-eloquent-relation","errorCode":null,"errorMessage":"Invalid eloquent relation","messagePattern":"Invalid eloquent relation","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Show.php","lineNumber":472,"sourceCode":"\n        if ($relation    instanceof HasMany\n            || $relation instanceof MorphMany\n            || $relation instanceof BelongsToMany\n            || $relation instanceof HasManyThrough\n        ) {\n            if (empty($arguments) || (count($arguments) == 1 && is_string($arguments[0]))) {\n                return $this->showRelationAsField($method, $arguments[0] ?? '');\n            }\n\n            $this->model->with($method);\n\n            if (count($arguments) == 1 && is_callable($arguments[0])) {\n                return $this->addRelation($method, $arguments[0]);\n            } elseif (count($arguments) == 2 && is_callable($arguments[1])) {\n                return $this->addRelation($method, $arguments[1], $arguments[0]);\n            }\n\n            throw new \\InvalidArgumentException('Invalid eloquent relation');\n        }\n\n        return false;\n    }\n\n    /**\n     * @param string $relation\n     * @param string $label\n     *\n     * @return Field\n     */\n    protected function showRelationAsField($relation = '', $label = '')\n    {\n        return $this->addField($relation, $label);\n    }\n\n    /**\n     * Handle model field.","sourceCodeStart":454,"sourceCodeEnd":490,"githubUrl":"https://github.com/z-song/laravel-admin/blob/67c441eb78ecc5437e59775d89770cd9c2cb1e05/src/Show.php#L454-L490","documentation":"Error \"Invalid eloquent relation\" thrown in z-song/laravel-admin.","triggerScenarios":"Thrown at src/Show.php:472 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"}