Closed lgrassini closed 2 years ago
Hi @lgrassini, thanks for writing in. Unfortunately that is not possible with this package, as this package caches the eloquent queries, not the models themselves.
So when we execute artisan modelCache:clear --model=App\SomeModelName
what are we clearing? a model or eloquent queries?
@lgrassini that clears all the cached eloquent queries that use that model.
Issue
I'm looking for a solution to invalidate cache for certain records and not for the entire model. Our scenario is the following: We have a Site entity handling thousands of websites using the Site model (and related models). We would like to be able to clear cache for a particular website and not for all the other websites cached with modelCache.
I can't found any instructions for doing this in the modelCache documentation.
How can we achieve this?
Environment
Laravel Version: 8.70.2 Laravel Model Caching Package Version: 0.10.3 PHP Version: 7.4.26 Operating System & Version: macOS 12.0.1