无法更新记录,因为外键

Can't update the record because foreing keys

我无法更新(不是删除)记录,因为来自辅助 tables 的外键不允许我这样做。

我知道我可以禁用外键,但如果我只是更新 "customer" table,我认为这不是一个很好的做法,它对辅助外键没有任何 FK。

这个问题有什么解决办法吗?

我的数据库架构

辅助之一tableFK

我得到的错误

这是我用来执行此操作的代码

  $customer = Customer::where('id', $id)->update($data);
  if($customer)
      return redirect('/customers/);

感谢#TheFallen 对我的帮助。

我在数组中包含自己记录的 ID,因此我将其从数组中取出,更新顺序使用活动外键。