Support the ongoing development of Laravel.io →
Cache Eloquent
Last updated 1 year ago.
0

I've also managed to rule out the following as possible causes: the cache driver, and the use of ardent instead of eloquent as the base class. If I call the afterUpdate() method manually from an overridden save method, then the getDirty() array doesn't seem to be populated properly... Could it be a problem with serialisation into the cache? I'm starting to tear my hair out a bit here, would really appreciate your help!

Last updated 1 year ago.
0
Solution

Ok, I solved the problem. When objects are taken out of the cache, the boot method isn't called, so event listeners don't seem to be initialised. I put in a __wakeup method which calls boot, registers the listeners and suddenly all works fine. Maybe this should be added to eloquent?

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

henreh henreh Joined 2 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.