DEV Community

Discussion on: Caching the Laravel user provider with a decorator

Collapse
 
matthewbdaly profile image
Matthew Daly

Yes, that's correct.

I touched on this in the prior article, but the way to handle changes to the user model is to use model events to trigger a listener that clears the cached item. That way, you can assign a single listener to multiple events and automatically clear the cache on any changes.