Open Roardom opened 1 week ago
We can also do updateQuietly
- this however prevents all model events/observers from being triggered (including Auditable
).
We can also do
updateQuietly
- this however prevents all model events/observers from being triggered (includingAuditable
).
Thanks for the alternative. In most cases that this hack is used, it's for bulk updates that don't send model events/observers anyways, so that shouldn't be an issue. However, if the goal is to not update the updated_at
timestamp, then it's probably better to call a function named withoutTimestamps
. We also generally try and avoid relying on too many model events/observers so that we can have more freedom to optimize our database queries.
Probably should refactor all of these at some point to use the idiomatic syntax.
Upvote & Fund