oxhq / cachelet-query
Query builder integration for Cachelet.
v0.3.1
2026-05-14 18:26 UTC
Requires
- php: ^8.2
- illuminate/database: ^12.0|^13.0
- oxhq/cachelet-core: ^0.3
README
Query builder and Eloquent result caching with Cachelet coordinates.
cachelet-query makes repeated query results inspectable by table, connection, SQL, bindings, pagination inputs, store, prefix, and scope.
Install
composer require oxhq/cachelet-query
Best Fit
Use this package when expensive query results are repeated and the invalidation boundary can be expressed by table, family prefix, tag, or explicit scope.
It provides:
cachelet()macros on query buildersrememberWithCachelet()convenience macro- SQL, binding, connection, and pagination-aware coordinates
- explicit
scope(...)support - canonical
module = querycoordinates and telemetry
Example
$results = User::query() ->where('role', 'admin') ->cachelet() ->ttl(300) ->rememberQuery();
Contract
cachelet-query guarantees explicit invalidation by query-table prefix and tags. It does not claim automatic relational invalidation for arbitrary query graphs in 0.2.x.