Skip to content

Issue: Model Cache Not Updating After Update/Delete #514

Closed
@mattscicluna2

Description

@mattscicluna2

Description:
I recently upgraded my Laravel project from v9 to v11, which required updating this package to the latest compatible version, v12.0.2. I also tested v0.13.0 on Laravel 10 and encountered the same issue.

The problem is that while the package successfully writes data into Redis, it does not update the cache when a model is updated or deleted. The changes are only reflected after running:

php artisan cache:clear

Steps to Reproduce:
Update a model record using Eloquent.
Check Redis – the old data remains.
Delete a model record.
Check Redis – the deleted data still exists.
Run php artisan cache:clear, and only then does the cache update properly.
Expected Behavior:
The cache should automatically refresh when a model is updated or deleted, without requiring a manual cache:clear.

Environment Details:
Laravel Version: 11.x (also tested on 10.x)
Package Version: v12.0.2 (also tested on 0.13.0 with Laravel 10)
Cache Driver: Redis
Any guidance or fixes would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions