mikebronner / laravel-model-caching

Eloquent model-caching made easy.
MIT License
2.22k stars 212 forks source link

Clear cache in a record of the model. #436

Closed Jesus-Rojas closed 1 year ago

Jesus-Rojas commented 1 year ago

Hi good day, wanted to disturb @mikebronner.

Pivot::updating(function ($pivot) { $source = new Source; $source->flushCache(); });

How to clean a record of the model without to clean all model, currently it was solved with method flush but this clean all cache of model.

Thanks!!

mikebronner commented 1 year ago

Hi @Jesus-Rojas, that is by design, there is no other feasible way to partially clear the cache for a model.

Jesus-Rojas commented 1 year ago

I understand, thanks so much @mikebronner .