Skip to content

Values are not being audited when using DB::beginTransaction #913

Answered by parallels999
alexfarrugia asked this question in Q&A
Discussion options

You must be logged in to vote

I'm using DB::beginTransaction and DB::raw the same, and everything works as expected
Only if it a bulk update, in that case it doesn't work

$payment=PaymentModel::query();
$payment->update([
    'amount' => DB::raw('amount - allocated_amount'),
]);
// this is not audited because is a bulk update, and it doesn't trigger laravel update event

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by parallels999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #901 on March 13, 2024 14:06.