如何去掉这个错误提示信息?
public function index(){
try{
\DB::connection()->enableQueryLog();
$where = [];
$where['id'] = 44;
$article = Articles::with("articles_class")->where($where)->get();
foreach ($article as $k=>$v) {
$v->article_desc = 3456;
$v->save();
if($v['id']==44){
$class = $v->articles_class;
$class->class_name = "class_name";
$class->save();
}
}
$queries = \DB::getQueryLog();
return Tools::jsonReturn(0,'ok',['article'=>$article,'sql'=>$queries]);
}catch (\Exception $e){
return Tools::jsonReturn(123,$e->getMessage());
}
}
程序可以正常执行,但是在$class->save();这里,phpstorm提示Method 'save' not found,如何消除这个错误?
推荐文章: