laravel-model-caching
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.
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*
laravel cache still show the deleted record when we delete record from database. cache is not updated after delete the record.
Bug
cuz the query is cached !!
try :
php artisan optimize:clear
@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
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 Please provide the above items I listed. It's hard for me to provide help without the necessary information. Thanks :)