deposit += $amount; if (0 < $amount) { $history->transfer_reason = DepositTransferReason::チャージ; } else { $history->transfer_reason = DepositTransferReason::チャージ_取消; } $deposit->save(); $history->save(); return $deposit; } }