一对多怎么样更新

JellyBool

$user->posts()->update();

大概这样

dope2008 回复 JellyBool

Array to string conversion

JellyBool 回复 dope2008

肯定是哪里写错了呗,数组当成字符串了

jayin

@JellyBool 一对多有没有像多对多这样的syns()更新删除新增的方法

RJustice

一对多的关系就是一个主key的链接, 如果你要 post 和 comment 更新 comment->post()->update(), 如果你要更新comments, 只需要独立更新comments就好了啊, 因为他们就没有更多的关联了. 不要转牛角尖