oxhq / cachelet-model
Eloquent model 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
Eloquent model caching with Cachelet coordinates.
cachelet-model gives model-derived cache entries a stable module identity, inspectable key payloads, and observer-driven invalidation for model cache families.
Install
composer require oxhq/cachelet-model
Best Fit
Use this package when stale model variants and invalidation blast radius are the main pain.
It provides:
Cachelet::forModel(...)$model->cachelet()only(...),exclude(...),withDates(), andwithTimestamps()- observer-driven invalidation for model prefixes
- canonical
module = modelcoordinates and telemetry
Example
use Oxhq\Cachelet\Traits\UsesCachelet; class User extends Model { use UsesCachelet; } $profile = $user->cachelet() ->exclude(['updated_at']) ->ttl(300) ->remember(fn () => $user->fresh());