{"record":{"id":"1932f7d2fca291a0","repo":"z-song/laravel-admin","slug":"model-is-not-a-valid-model","errorCode":null,"errorMessage":"$model is not a valid model","messagePattern":"\\$model is not a valid model","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Admin.php","lineNumber":156,"sourceCode":"        return new Content($callable);\n    }\n\n    /**\n     * @param $model\n     *\n     * @return mixed\n     */\n    public function getModel($model)\n    {\n        if ($model instanceof Model) {\n            return $model;\n        }\n\n        if (is_string($model) && class_exists($model)) {\n            return $this->getModel(new $model());\n        }\n\n        throw new InvalidArgumentException(\"$model is not a valid model\");\n    }\n\n    /**\n     * Left sider-bar menu.\n     *\n     * @return array\n     */\n    public function menu()\n    {\n        if (!empty($this->menu)) {\n            return $this->menu;\n        }\n\n        $menuClass = config('admin.database.menu_model');\n\n        /** @var Menu $menuModel */\n        $menuModel = new $menuClass();\n","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/z-song/laravel-admin/blob/67c441eb78ecc5437e59775d89770cd9c2cb1e05/src/Admin.php#L138-L174","documentation":"Error \"$model is not a valid model\" thrown in z-song/laravel-admin.","triggerScenarios":"Thrown at src/Admin.php:156 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"}