amelia/rememberable
Amelia Rememberable adds query caching to Laravel's Eloquent ORM, letting you cache expensive database queries and reuse results with a simple trait. Cut repeated queries, speed up slow pages, and keep your models fast with minimal code changes.
remember() semantics, write Cache::remember() inline, use a maintained equivalent (watson/rememberable), or layer on a response cache. This package sits at the "small, cheap, single-purpose dependency" end of that spectrum — but the new default-on behavior pushes it toward "framework-ish" territory that a 10-star dependency hasn't earned.DB::table(), raw SQL, mass updates, queue workers, other services writing the same tables) will serve stale data for a full TTL. This directly informs which bounded contexts are safe to onboard (reference/lookup data) versus which are not (inventory, pricing, entitlements).Consider it when:
composer.json / CI, not inferred from the release note, which says nothing about framework or PHP compatibility. Prior guidance assumed Laravel 5.x only; v3.0.0-beta1 is a new, unverified baseline.Look elsewhere when:
watson/rememberable) or native Cache::remember() at similar effort.Cache::remember() calls beats adding a dependency with an uncertain maintenance story.Executives: Query caching is still a cheap, high-leverage way to cut database load and improve response times on read-heavy parts of the product. The package just shipped a beta (v3.0.0-beta1) that makes caching fully automatic — add the trait to a base model and every query on that model is cached, with no per-query work. That is a genuine ergonomics win and it moves our prototype cost down. It does not change the lifecycle story: it is a beta from a package with 10 stars, zero dependents, and a prior release history ending in 2016, and the release note doesn't state which Laravel or PHP versions it supports. A major version number also means breaking changes, so anything we documented before is stale. Recommendation: hold the existing decision. Do not standardize on it. Fund the same short timeboxed experiment, now with an explicit rule that the beta stays behind a feature flag and is never switched on by default in production. If the numbers justify caching, implement it with a maintained package or roughly twenty lines of native Laravel caching. Low cost, contained risk — provided we treat the beta as a trial and not a decision.
Engineering:
Rememberable trait for Eloquent models that restores Laravel 4-style query caching, keyed off generated SQL and bindings, with cache invalidation hooked into model events. v3.0.0-beta1 adds automatic query caching — no ->remember($minutes) needed at call sites; inheritance from a base model is the only wiring.->remember(), but every query a model emits is now cached, including ones nobody profiled, and every one of them depends on model events firing for invalidation.composer.json before writing any code. No CI or coverage signal mentioned. Beta means behavior and public API may still move. Major version bump implies breaking changes versus prior usage.use statement on a base model, plus TTL configuration. No schema changes, no new infrastructure — but budget for the inverse work: an inventory of queries that must be excluded, and a mechanism (wrapper or trait override) to exclude them, since the beta's selling point is that you don't think about this per query.watson/rememberable as the maintained alternative in parallel. Deliver a go/no-go with the maintenance- and correctness-risk tradeoff written down.How can I help you explore Laravel packages today?