[6.x] Forms 2: Access#14950
Open
duncanmcclean wants to merge 6 commits into
Open
Conversation
jasonvarga
requested changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request implements form access controls, letting you restrict when a form accepts submissions. You can schedule a close date, cap the number of submissions, and require visitors to be logged in.
These "restrictions" can be configured in the form's settings. They're enforced server-side when the form is submitted and surfaced to templates so they can limit when the form is rendered.
Options
When a limit period is set, the counter resets at the app timezone's midnight / start of the week / start of the month.
Preventing submissions
The simplest way to prevent visitors submitting closed forms is to wrap the form's contents in a conditional:
{{ form:contact }} {{ if restricted }} <p>{{ restriction_message }}</p> {{ else }} {{ fields }} ... {{ /fields }} {{ /if }} {{ /form:contact }}Statamic will also reject submissions server-side and return a validation error when a form is restricted.
Form status
This PR adds a
$form->status()method which returnsopen,closed, orlimit_reached.The status is visitor-agnostic — describing the form's lifecycle rather than if a given visitor can access the form (so
require_logindoesn't affect it.A status indicator has been added to form pages across the Control Panel: