A model reports its own changes, and cache clearing rests on that. But two ways of changing a field raise DIFFERENT events, and the difference once cost us wrong stock figures on the site.
$product->save(); saving, updating, updated, saved
$product->decrement("stock"); updating, updated — and that is allCounters do not raise the "saved" event at all. So subscribe to "created" and "updated": between them they cover both an ordinary save and writing stock off on a purchase.
Discussion
0Only signed-in visitors can comment. Sign in to write.
Nobody has spoken up yet. Be the first.