mikebronner / laravel-model-caching

Eloquent model-caching made easy.
MIT License
2.26k stars 217 forks source link

laravel cache still show the deleted record when we delete record from database. cache is not updated it show the deleted record. #308

Open Pankajmaurya138 opened 4 years ago

Pankajmaurya138 commented 4 years ago

Issue

summarize your issue here

Environment

Laravel Version: 6.2 Laravel Model Caching Package Version: ^0.7.3 PHP Version: 7.2 Homestead Version: x.y Operating System & Version: win 10

Stack Trace

*paste the relevant, complete stack trace here*
Pankajmaurya138 commented 4 years ago

laravel cache still show the deleted record when we delete record from database. cache is not updated after delete the record.

Bug

mansourBeta commented 4 years ago

cuz the query is cached !!

try : php artisan optimize:clear

mikebronner commented 4 years ago

@Pankajmaurya138 Please provide more information:

Pankajmaurya138 commented 4 years ago

actually it happen in that case when i am using the model cache. scenario of this problem, when i visited the specific url which have the product list page. model cache store that query in cache of product list query. when i am delete the one record from the product list then its not update the cache and still get the deleted record in the product list. my query is that always need to call php artisan model-cache:clear after delete or update record.??

mikebronner commented 4 years ago

@Pankajmaurya138 Please provide the above items I listed. It's hard for me to provide help without the necessary information. Thanks :)