Increment\Decrement with other attributes. #55672
-
Hi! Here one example:
Increment fired update event. But how I can detect full_name is stored to DB or not?
But full_name not stored in DB yet... |
Beta Was this translation helpful? Give feedback.
Answered by
macropay-solutions
May 8, 2025
Replies: 2 comments 2 replies
-
getOriginal must be used in updated event, wasChanged must be used in updating event. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Observer
Here is no differences in dump results:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to use
$book->increment('some_value', extra: ['full_name' => $book->full_name]);
or
$book->increment('some_value', extra: ['full_name' => Str::random()]);
or
$book->increment('some_value', extra: $book->getDirty());