- How do I install laravel-enso/rememberable in a Laravel app?
- Install the package with Composer, then add the Rememberable trait to the Eloquent models you want to cache. Configure the cache store and TTL according to your application needs, and validate invalidation behavior on writes. Because this is an Enso dependency, verify generic Laravel compatibility with a small proof of concept before broader adoption.
- What does laravel-enso/rememberable cache in Eloquent models?
- The package provides transparent query caching through a trait, so cached values are primarily query results rather than an ORM identity map. The provided context does not confirm whether relationships, pagination metadata, or null results are cached in every case. Test the exact query shapes you rely on before assuming behavior for eager loading, empty results, or complex scopes.
- Does laravel-enso/rememberable automatically invalidate cache on model save or delete?
- The package overview states that cached results are automatically invalidated when models are created, updated, or deleted. You should still verify behavior for bulk updates, raw SQL writes, transactions, and writes that bypass Eloquent events. Treat invalidation correctness as a production-critical item and test it against your actual write paths.
- Which Laravel and PHP versions does laravel-enso/rememberable support?
- The provided context does not list exact Laravel or PHP version constraints. Inspect the package composer.json, tests, and CI configuration, then compare those constraints against your current Laravel and PHP matrix. Do not assume compatibility from the README alone; run a compatibility spike with your pinned framework version.
- How do I configure cache TTL and cache store for laravel-enso/rememberable?
- Configure TTL and the cache store through your Laravel cache configuration and any package-specific options exposed by the trait. Redis or Memcached is a stronger fit than file or database cache when you need tags, atomic invalidation, and higher concurrency. Document the chosen TTL and invalidation strategy because cache correctness depends on application write patterns.
- Does laravel-enso/rememberable support cache tags?
- The package description mentions optional tags for cached query results. Tag support depends on the underlying Laravel cache store, so confirm that your store supports tags before relying on them. Test tag-based invalidation with the same write paths you use in production.
- Can I use laravel-enso/rememberable with multi-tenant or auth-scoped queries?
- You can use it, but you must design cache-key composition carefully so tenant and auth scopes are part of the key or excluded from caching. The package is unlikely to infer multi-tenant or user-specific scoping automatically. Avoid caching globally keyed results for auth-dependent queries, and validate behavior with tenant switching and permission changes.
- How should I test laravel-enso/rememberable before using it in production?
- Pilot the trait on one read-heavy, low-risk model behind a feature flag and compare hit rate, query volume, latency, and stale-read incidents against the uncached path. Test create, update, delete, bulk writes, eager loading, pagination, null results, transactions, and cache-store outages. Also inspect the package tests and CI before pinning a version in your lockfile.
- What are production risks of using laravel-enso/rememberable for model caching?
- The main risks are stale data after writes, missed invalidation, cache-store outages, hot keys, stampedes, memory pressure, and cross-region consistency if applicable. The package is small and niche, so maintenance continuity and limited independent production evidence are also concerns. Instrument hit and miss rates, latency, database load, and invalidation failures, and keep a rollback path to native caching.
- What are alternatives to laravel-enso/rememberable for Eloquent query caching?
- The simplest alternative is native Laravel Cache::remember with explicit keys and tags, which gives you full control over key composition and invalidation. You can also hand-roll model-level caching or evaluate other Laravel caching packages. If the Rememberable package shows weak invalidation or compatibility behavior, fall back to first-party caching and document the decision.