📜  使用 Eloquent 更新数据透视表 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:47.194000             🧑  作者: Mango

代码示例1
$user = User::find(1);

$user->roles()->updateExistingPivot($roleId, [
    'active' => false,
], false);

//The last param is to not update time updated_at column timestamp.