laragear/cache-query
Cache your Laravel Eloquent queries and get fast, consistent results without hitting the database on every request. It hooks into the query builder, so you can cache models, counts, and relationships with a simple chainable call.
->cache() wrapper on Eloquent queries gives the team a low-friction way to cut database load on read-heavy screens (dashboards, catalogs, search results, feeds) without standing up a bespoke caching layer. This is a concrete lever when the roadmap says "reduce p95 latency" or "survive traffic spikes without a DB upgrade."Adopt when:
Look elsewhere when:
To executives: This is a small, free (MIT-licensed) Laravel package that lets our engineers cache database query results with a single line of code. It targets a common cost driver—repeated expensive reads—and offers a fast, low-risk path to lower latency and reduced database spend without a platform rebuild or new vendor contract. It won't fix every performance problem, and it needs disciplined cache-invalidation rules, but it's a cheap, reversible experiment with clear success metrics (query volume, p95 latency, DB cost). Note the package just shipped a v6.0.0 major release; we'll validate the upgrade in a scoped spike and pin the version before rollout.
To engineering: It's an Eloquent query-cache wrapper—adopt it as the default for stable, read-heavy queries and keep custom caching out of the codebase. The trade-offs are explicit: we own TTLs and invalidation correctness, we pin the version given the modest star count and thin dependent base, and we benchmark before/after per surface. v6.0.0 is a semver-major bump, so treat it as a potential breaking change: review the changelog, budget a migration spike, and confirm API compatibility before upgrading. It complements—not replaces—query optimization, indexing, and read-replica work, and it keeps caching logic co-located with the queries it serves.
How can I help you explore Laravel packages today?