v2.2.1
Cache safety fixes for whereHas/ join inference, nested eager loads, one-of-many relations, and Redis Cluster — plus reduced round trips on both cold and warm paths.
Fixed
- Relation definitions with built-in
whereExists, raw predicates, or non-inferrable joins now bypasswhereHas/withCountinference instead of caching under incomplete dependencies. count(),exists(),sum(),avg(),min(),max(), andpaginate()with a manualwhereExistsnow bypass unlessdependsOn()is declared.lockForUpdate()andwithoutCache()inside awhereHasconstraint now prevent the outer query from being cached.- Plain
join()auto-inference extended to scalar and pagination paths, and now correctly bypasses on complex join predicates, implicit table aliases, or inside
withCount()/withAggregate(). - Through-relation
tag()andttl()now applied to result fetch and store calls. - Pivot-relation
ttl()now applied to result writes;tag()bypasses pivot caching. - Nested eager loads on a cached
belongsTorelation (e.g.with('order.customer')) are now hydrated instead of being silently dropped. latestOfMany()/oldestOfMany(),hasOne, andhasOneThroughrelations now correctly track their cache dependency.- Fixed cross-slot
EVALSHAerrors when running against a real Redis Cluster with multi-dependency queries.
Changed
- Reduced Redis round trips for cold cache misses across model hydration, relation loading, and the build-lock recheck.
- Cache hits on query/through/pivot lookups now decode their JSON payload in PHP instead of in Lua, avoiding Lua's slower bulk-reply marshaling on the warm path.
Full Changelog: CHANGELOG