vectorial1024/laravel-cache-evict
This is an operations/hygiene dependency, not a feature. Its product value is expressed in incidents avoided and engineer-hours saved, not in user-facing capability. Frame any adoption case in those terms.
file and database cache stores do not reliably reclaim expired entries on their own — expired rows/files can linger until something reads or sweeps them. Redis/Memcached handle expiry natively. This package makes the "keep the database cache store" option operationally viable, which is a real architectural decision: staying on the DB cache store can avoid adding Redis to the stack (fewer moving parts, less ops cost) if eviction is automated. That is a decision this package directly enables.Decision this assessment does not support: any claim about feature completeness, driver coverage, or long-term maintenance. Public signals are thin (small star count, sparse documentation), and the available release note describes only a PHP-requirement relaxation. Treat capability claims as unverified until engineering reads the source and composer.json.
Consider it when:
DELETE statements, and you want it to be lock-safe when the scheduler runs on more than one node.Look elsewhere or defer when:
Cache::flush()-adjacent task, or doing nothing, may be cheaper than any dependency — including the review cost.composer.json and the source before planning around it.To executives (one paragraph): This is a small, MIT-licensed maintenance dependency that automatically removes expired cache entries from Laravel applications using the file or database cache. Its value is risk reduction and cost avoidance: it prevents cache data from growing without bound, which is a known cause of disk-full outages and database bloat, and it lets us keep a simpler cache setup instead of adding another infrastructure component. Cost is near zero — no license fee, no vendor contract, a patch-level integration — and it is reversible: if we stop using it, we delete a scheduled job. The trade-off is concentration risk: the project has a small public footprint and a single-maintainer profile, so I recommend adopting it only for this narrow operational job, with our own monitoring and a fallback one-command purge, and revisiting if we migrate the cache backend.
To engineering (the ask): Evaluate whether this replaces or duplicates work we'd otherwise hand-roll, and confirm three things before we schedule it: (1) which cache drivers and Laravel/PHP versions are actually supported — read composer.json and the source rather than the README; (2) how deletion is batched and whether the queries use existing indexes, so the job doesn't lock or full-scan a large table in production; (3) whether it takes a lock, so overlapping scheduler runs across multiple app nodes can't collide. Then compare against a ~50–150 line scheduled command with chunked deletes and withoutOverlapping() — if our own version is comparably safe and testable, owning it may be cheaper than a dependency with a thin maintenance signal. If we adopt, run it on staging first, measure job runtime and rows/bytes reclaimed, set an alert on cache table size or cache directory growth, and document the cadence as our data-retention statement for cached payloads.
Success metrics to agree up front: cache table rows or cache directory size held flat over 30 days; eviction job p95 runtime within an acceptable window; zero lock-contention or failed-job alerts; no measurable latency regression on cache reads/writes during the job. If those hold, the decision is validated. If the job cannot keep up with growth, that is the trigger to revisit the cache-backend decision rather than to tune this package further.
Caveat for both audiences: Public documentation is thin and the release history available to us describes a compatibility change, not capabilities. This recommendation is a conditional adoption for operational hygiene only; it should not be cited as evidence that the package is feature-complete, well-maintained, or suitable for anything beyond scheduled cache cleanup.
How can I help you explore Laravel packages today?