oxhq/cachelet-model
Cachelet Model adds automatic, cache-aware model updates to Laravel Eloquent: model saves and deletes invalidate related cache keys so your queries stay fast without serving stale data. Simple configuration, minimal code changes.
Cachelet Model v0.1.0 is the first public release of the Eloquent integration for Cachelet. Important context up front: this repository is a read-only split generated from the main monorepo at https://github.com/oxhq/cachelet. That means the split repo gives you installable code and tags, but not the authoritative docs, issue tracker, or contribution path.
Minimal steps:
vendor/name in the split repo's composer.json rather than assuming it from the repo title, then composer require that name at ^0.1.oxhq/cachelet. The split repo will not carry its own guides, and any README there is likely a generated pointer back to the monorepo.php artisan vendor:publish) and a trait or base model you opt into. Identify both before writing code — v0.1.0 gives you no migration path if you wire it in the wrong layer.Cache::remember() around it. That is the lowest-risk way to evaluate whether the abstraction earns its place over Laravel's native cache facade.Treat v0.1.0 as an evaluation release. At 0.1.x, the public API surface is by definition unstable, so prototype on a branch rather than baking it into a shared base model.
Because the release notes contain no API detail, the patterns below describe how to approach the integration and what to verify, rather than exact calls.
Cache::remember() is that it can hook model events (saved, deleted, restored) for invalidation. Confirm the package registers those hooks; if it doesn't, you are paying abstraction cost for nothing and should stay on the facade.DB::listen counter or Telescope tag, and confirm hit rates before expanding. A v0.1 cache layer is easy to add everywhere and hard to reason about afterwards.0.1 → 0.2 API change is a one-file diff, not a codebase-wide sweep.CACHE_DRIVER=array in phpunit.xml so cached reads don't leak across tests, and add a test that asserts the cache is invalidated after a model update — this is the failure mode that bites in production and is invisible in local dev.DB::table(...)->update() or bulk Model::query()->update() bypasses model events, so event-driven invalidation won't fire. Route writes through Eloquent instances, or flush explicitly.oxhq/cachelet.Model::query() with the cache disabled) and compare. If the uncached path is correct, the problem is invalidation, not the query.0.1 — it lets you roll back incrementally."vendor/cachelet-model": "0.1.*" rather than ^0.1 if you're deploying anywhere that matters; pre-1.0 minor bumps are allowed to break under semver and this package has exactly one release of history to judge from.Given the thinness of the v0.1.0 notes, the most useful next step is a short spike: install it, wrap one query, and read the upstream monorepo docs in full. Revisit this assessment once 0.2 or a documented API reference lands.
How can I help you explore Laravel packages today?