更新时间:2021-08-04 21:24:26
我认为您只需要使用不带任何参数的save()
方法.我已经在php artisan tinker
中以相同的结构进行了尝试.在遇到相同的错误后,我尝试删除save()
方法中的$entity
参数:
I think you just need to use save()
method without any parameters. I have try it in php artisan tinker
with same structure. And after I get same error, I try to remove the $entity
parameter inside save()
method:
// After update, you should only use save() not save($entity)
$entity->address->save();
我希望我能为您的问题提供正确答案:-D
I hope I give correct answer for your problem :-D
类型错误:传递给Doctrine\Common\Collections\ArrayCollection :: __ construct()的参数1必须为数组类型,给定对象
类型错误:传递给Illuminate \ Database \ Eloquent \ Builder :: create()的参数1必须为数组类型,给定null
传递给Illuminate \ Database \ Grammar :: parameterize()的参数1必须为数组类型,给定字符串
laravel类型错误:传递给Illuminate \ Database \ Eloquent \ Model :: save()的参数1必须为数组类型,给定对象