mitydigital/statamic-form-submission-cleaner
A Statamic addon for cleaning up stored form submissions. Configure retention rules to automatically remove old or unwanted entries, keeping your site tidy and your database free from unnecessary submission data.
Architecture fit. mitydigital/statamic-form-submission-cleaner is a Statamic addon, not a general-purpose Laravel package — it depends on Statamic's form-submission repositories and asset container APIs. It fits the standard Statamic addon pattern: auto-discovered service provider, publishable config, and an Artisan command intended to be registered in the Laravel scheduler. That is the right shape for a retention/TTL job and means no forking of Statamic core or custom control-panel code. The trade-off is that the package is only usable in stacks that already run Statamic; it has no value in a plain Laravel app.
Integration feasibility. Low effort. composer require, publish the config, set a retention window, add one scheduler line. No database migrations, no schema changes, no front-end work. The only real configuration surface is retention period, form handles, and which fields hold assets.
Release 1.1.1 assessment. This is a patch with no new features, no deprecations, and no public API change. It wraps asset values in Arr::wrap so that a single-file upload (scalar/asset object) and a multi-file upload (collection) are handled on the same code path. The practical effect is that submissions containing exactly one uploaded file now get their asset deleted alongside the submission record; previously that path could silently skip the file.
Technical risk. Overall low, with three caveats worth flagging to stakeholders:
Arr::wrap normalises shape but does not de-duplicate: if the same asset is referenced by multiple submissions or by content outside the form, deletion semantics are undefined from the release notes alone.Key questions for the maintainer / our own spike:
.meta folders), or leave those behind?Stack fit. Laravel 9–11 + Statamic 4/5, running the standard Laravel scheduler (or a queue worker if we wrap the command). Composer-installed, config-driven, no runtime dependency on our application code. Fits alongside the rest of our Statamic addon set without conflict.
Migration path. composer update mitydigital/statamic-form-submission-cleaner to ^1.1.1. No config changes, no data migration, no downtime. If we are on 1.1.0 or below, this is a drop-in patch.
Compatibility. Semver-safe patch bump; no changes to config keys, command signatures, or published assets. Safe to pin to ^1.1 and let Renovate/Dependabot carry future patches. The one thing to confirm is the Statamic major-version constraint in composer.json — that, not the patch level, is what will actually block an upgrade.
Sequencing.
Maintenance. Small, single-vendor package from a digital agency, with a low commit cadence and a small contributor base. Vendor-continuity risk is real but bounded: the code surface is narrow and the logic is simple enough to fork or reimplement in-house in a day or two if maintenance lapses. Recommend pinning and monitoring rather than treating it as critical infrastructure.
Support. GitHub issues/PRs only; no commercial SLA. Acceptable for a background housekeeping job where a delayed fix is inconvenient rather than customer-facing.
Scaling. The command is I/O- and query-bound: it walks submissions, then resolves and deletes assets one at a time. Runtime grows roughly linearly with the retention backlog, and there is likely an N+1 pattern per submission over its asset field. At our current volume this is a non-issue; if submission volume grows by an order of magnitude, expect the first run after a retention-window change to be long. Mitigations: run off-peak, chunk the date range over several nights, or wrap the command in a queued job with a timeout.
Failure modes.
Ramp-up. Very low. A Laravel developer unfamiliar with the package can read the source and be productive in half a day; most of that time should go on the staging dry-run and storage diff, not on the code. The real onboarding cost is procedural: whoever owns data retention needs to know this command exists and what it deletes, so it appears correctly in our retention documentation.
How can I help you explore Laravel packages today?