petkakahin/eloquent-redis-mirror
A Laravel package that mirrors Eloquent models into Redis, keeping cached copies in sync on save and delete so you can serve fast reads without touching the database. Drop-in setup that leaves your existing Eloquent workflow unchanged.
find(), with(), first(), paginate(), and exists().Consider adoption when:
create/update/delete/restore), and the database remains the source of truth.Look elsewhere when:
For executives: This package is a drop-in Redis mirror for Eloquent models that can cut database read load and improve response times for read-heavy features. It keeps the database as the source of truth, synchronizes writes automatically through Eloquent, and falls back to the database if Redis is unavailable. The first stable release includes 324 tests and passes PHPStan at max level. Recommend a contained pilot on one high-read model with clear success metrics: p95 read latency, database CPU/read volume, Redis hit rate, and stale-read incidents.
For engineering: Adoption is low-friction—add one trait and keep the standard Eloquent API. Reads like find(), with(), paginate(), and exists() are served from Redis, while writes update Redis through model events. Relations and eager loading are supported, including custom relation mappings. Batch writes use MULTI/EXEC for atomicity, and Redis outages fall back to the database. Key caveats: cache invalidation depends on Eloquent write paths, so raw SQL and bulk query-builder writes need explicit handling; Redis memory, eviction, TTLs, and sensitive-data controls must be defined; and custom relation behavior should be tested before rollout. This is a performance layer, not a replacement for the database.
How can I help you explore Laravel packages today?