Options
Out of the box, Form Submission Cleaner for Statamic is ready to go - no additional configuration file is required, but can optionally give you advanced control. The default options are to:
apply to all Forms
remove Submissions and uploads (Assets, if your Form Blueprint uses it)
that are older than 30 days
You can adjust these defaults yourself - make sure you publish the configuration file first:
1php artisan vendor:publish --tag=statamic-form-submission-cleaner-config
The configuration file is split in to two sections - one for the defaults, and one for form-specific configuration.
To make it easier, the defaults will automatically apply to all forms you have configured - whether that is all forms, or selected forms only.
This means you can choose to:
apply the default options to all forms (the default behaviour),
apply the default options to selected forms, or
override the default options for specific forms, and allow others to use defaults
Don't worry, it's easier than it sounds.
Defaults
The defaults will automatically
days
The number of days Submissions (and Assets) will be kept for.
Default to 30 days.
delete_assets
When a cleanup is performed, should Assets be deleted?
Note: this only applies to Assets that are listed as an uploaded Asset as part of a Form Submission.
Default to true
.
Set to false
to keep Assets.
If set to false
, but delete_submissions
is set to true
, you will end up with orphaned files - just keep an eye on those.
delete_submissions
When a cleanup is performed, should Submissions be deleted?
Default to true
.
Set to false
to keep Submissions.
query_scopes
You can attach multiple Query Scopes to the logic that gets applied to the Submission lookup when determining what needs cleaning.
There's a whole section on Query Scopes too.
Forms
When you install Form Submission Cleaner for Statamic, it will apply to all Forms in your site.
You'll see all
is set in the config file.
1'forms' => 'all',
You can also change this to an array of form handles, or more advanced overrides too.
Check out the Forms section for a detailed breakdown of how you can use and override the Defaults.