laravel-model-caching icon indicating copy to clipboard operation
laravel-model-caching copied to clipboard

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

Open Pankajmaurya138 opened this issue 5 years ago • 5 comments

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 avatar Dec 09 '19 08:12 Pankajmaurya138

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

Bug

Pankajmaurya138 avatar Dec 10 '19 11:12 Pankajmaurya138

cuz the query is cached !!

try : php artisan optimize:clear

mansourBeta avatar Dec 19 '19 05:12 mansourBeta

@Pankajmaurya138 Please provide more information:

  • What is the eloquent query you are having trouble with?
  • What caching driver are you using?
  • You should clear the cache after deploying or updating: php artisan model-cache:clear

mikebronner avatar Dec 19 '19 15:12 mikebronner

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.??

Pankajmaurya138 avatar Dec 23 '19 13:12 Pankajmaurya138

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

mikebronner avatar Dec 23 '19 15:12 mikebronner