helgesverre/laravel-prunekeeper
PruneKeeper gives Laravel apps a central home for model pruning: define retention rules, schedule prune commands, and track what gets cleaned up so your database stays lean without scattered ad-hoc cleanup scripts or guesswork.
prunekeeper.compression.driver or --compression) rather than an engineering task. That directly de-risks GDPR-style retention deadlines and storage-cost reduction initiatives.Prunekeeper::makePrunableQuery() lets soft-deleted rows be included in pruning scope. This decides whether "recycle bin" features are safe to ship — previously you'd need custom query logic per model.Prunekeeper::flushState() for test isolation is a signal the package targets CI pipelines. Budget for test-suite updates when adopting, not for building test scaffolding.void instead of $this. Any prototype built against pre-2.0 needs a rewrite of call sites and callbacks. Price that into the pilot decision rather than assuming a drop-in bump.Adopt when most of these hold:
DELETE statements.flushState()).Look elsewhere when:
delete() or native table partitioning is less surface area.ext-zip, ext-zlib, ext-bz2, ext-phar). Shared hosting, minimal container images, or locked-down platform builds may not have them — verify before promising gzip/bzip2 in a roadmap.For executives: This is a small, free dependency that lets us delete old database records without losing them — they get compressed into archive files first. It reduces storage cost and gives us a repeatable answer to data-retention requirements, instead of an untested script per table. It reached its first stable release (v2.0.0), which is the point at which it becomes reasonable to depend on.
For engineering: v2.0.0 is the first production-ready cut. It follows Laravel first-party patterns (static API), gives us four compression drivers behind one config key, a soft-delete-aware query helper, flushState() for test isolation, and temp-file cleanup on exporter failure. Treat it as breaking from any pre-release — static methods and void-returning config callbacks require call-site and callback edits. Recommended path: pilot on one high-growth, low-risk table (e.g. application logs) with the default zip driver, confirm disk/retention behaviour over a couple of cycles, then roll out. Validate that the required PHP extensions exist in our production images before we commit to a format.
How can I help you explore Laravel packages today?