directorytree/activeredis
ActiveRedis provides a simple, efficient, Eloquent-like active record API for interacting with Redis hashes in Laravel. Define models and create, update, delete, expire, and query records, with support for casts, events, timestamps, chunking, and searching.
setExpiry() / getExpiry() make retention policy a first-class model concern instead of a cron job, which directly supports data-retention and privacy decisions.create, find, query, chunk, each, events, observers, casts) means the existing team's mental model carries over. This lowers the bus factor versus a bespoke Redis helper only one engineer understands.searchable attribute list is effectively immutable once records exist. That forces an explicit, documented decision about what you will query on — useful discipline, but it must be treated as a schema sign-off, not a code detail.Adopt when most of these hold:
SCAN iteration is acceptable (thousands, not tens of millions, of keys) or queries are overwhelmingly find()-by-key with only occasional iteration.Look elsewhere when:
SCAN-with-pattern plus an immutable searchable field is not a query engine; reach for a relational DB, Redis Search/RediSearch, or a purpose-built store.SCAN cost grows with the number of keys and Redis makes no count guarantees, so bulk operations become a latency and capacity risk.Net: viable for a bounded, non-critical feature; not a platform bet. Budget a short technical spike to confirm scan behavior and connection isolation before committing.
For executives / steering: This is a small, MIT-licensed Laravel package that gives our Redis hashes an Eloquent-style interface. It removes boilerplate for a pattern we'd otherwise write ourselves, adds built-in per-record expiry for retention control, and requires no new infrastructure. Cost to trial is a composer install, one connection config entry, and a handful of model classes. The trade-off is immaturity — tiny adoption, single maintainer — so we should not make it a strategic dependency. Recommendation: pilot it behind a thin internal interface on one ephemeral, non-critical feature, timeboxed, with an explicit exit path.
For engineering: You get models, UUID-or-custom keys, timestamps, casts and enums, lifecycle events and observers, TTL expiry, chunking, and a find/query API over Redis hashes. Two things to design around from day one: (1) queries use SCAN with a MATCH pattern, so bulk iteration is O(keyspace) — use find() where possible and keep per-model keyspaces small; (2) searchable attributes are effectively schema and must be frozen before production data exists. Also take the README's advice and give these models their own Redis connection/database so scans don't sweep cache, queue, and session keys. Wrap it in a repository so we can swap the backing store without touching call sites.
For the sponsor asking "what if it's abandoned": The package is thin and its surface is small; the escape hatches are (a) the internal adapter, and (b) the fact that the data lives in plain Redis hashes we can read directly with any client if we have to. That keeps the downside contained to migration effort, not data loss.
How can I help you explore Laravel packages today?