W3Cschool
恭喜您成为首批注册用户
获得88经验值奖励
如果你需要在中间表中更新一条已存在的记录,可以使用 updateExistingPivot 。此方法接收中间表的外键与要更新的数据数组进行更新:
$user = App\Models\User::find(1);
$user->roles()->updateExistingPivot($roleId, $attributes); Copyright©2021 w3cschool编程狮|闽ICP备15016281号-3|闽公网安备35020302033924号
违法和不良信息举报电话:173-0602-2364|举报邮箱:jubao@eeedong.com

扫描二维码
下载编程狮App

编程狮公众号
联系方式:

更多建议: