Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kendafulp's avatar

How many is too many?

When doing 1 by 1 update inside a loop, how many is too many?

I have a pivot table, and submits a form that updates multiple rows at once. I know it's not really recommended to perform update in a loop, However, in the Pivot's "boot" method, I have setup a static::updating() hook, but if I do massive update and use sync() or upsert(), the hook is never triggered.

0 likes
1 reply
martinbean's avatar

@kendafulp I guess the first question is, what is in that updating hook that’s so important when modifying pivot values?

Please or to participate in this conversation.