laravel 事務不提交 不知道哪裡寫錯了
以下是程式碼
DB::transaction(function () use ($payment,$userBalance) {
Payment::insert($payment);
$userName = $payment['payment_user_name'];
User::where('user_name', $userName)
->increment('user_balance', $userBalance);
});
跪求指教