Retrieved Observer not firing from CachedBuilder #510
Replies: 3 comments
-
Hi @paularmstrong80, thanks for moving this over to a new issue. I'm going to have to ponder this a bit, but I can see where you're coming from. |
Beta Was this translation helpful? Give feedback.
-
Coming from this exact same issue (getting |
Beta Was this translation helpful? Give feedback.
-
There is a event Illuminate\Cache\Events\CacheHit which might be useful to you |
Beta Was this translation helpful? Give feedback.
-
Hi Mike,
First, thank you for the great package, really appreciate your work!
I came across this issue when attempting to hook into the model's retrieved event.
The retrieved event only fires if the result hasn't been cached. Once the result is in cache, it no longer fires.
To work around the issue I had to do the following:
My solution is not pretty, but works. I had troubles doing it other ways because of the debug_backtrace in the cacheValue event.
If there's a way to improve this solution, and/or get it into core, that would be amazing.
Kind Regards,
Paul
Originally posted by @paularmstrong80 in #171 (comment)
Beta Was this translation helpful? Give feedback.
All reactions