我正在尝试使用associate注释模型从视图中获取文档模型当前的id。但按下按钮后。上面总是写着。调用未定义方法Illuminate\Database\Query\Builder::associate()
class CommentController extendscommentObject = new Comment();
$commentObject->asso
我通常创建新实例并填充属性,然后使用setRelation()和associate()方法手工关联它们(因为我喜欢使用父-子和子-父方法检索关系)。问题是:我是否做了正确的事情,给setRelation和associate打分模型关系?如果没有,我将如何检索$model->children()/$model->parent()关系?/ set relations $pl
model.associate = function (models) { a.hasOne(models.b);// associations can be defined here
b.belongsTo(models.a)我的问题是,"model.associate“属性是否仍然适用于v5^? 注意:我使用了s