Skip to content

[6.x] Forms 2: Access - #14950

Merged
jasonvarga merged 9 commits into
forms-2from
forms-2-access-restrictions
Jul 7, 2026
Merged

[6.x] Forms 2: Access#14950
jasonvarga merged 9 commits into
forms-2from
forms-2-access-restrictions

Conversation

@duncanmcclean

@duncanmccleanduncanmcclean commented Jul 7, 2026

Copy link
Copy Markdown
Member

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

CleanShot 2026-07-07 at 15 26 50

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 }}
{{ ifrestricted }}
<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 returns open, closed, or limit_reached.

The status is visitor-agnostic — describing the form's lifecycle rather than if a given visitor can access the form (so require_login doesn't affect it.

A status indicator has been added to form pages across the Control Panel:

CleanShot 2026-07-07 at 15 25 38CleanShot 2026-07-07 at 15 25 26

Comment threadsrc/Forms/Form.php Outdated
Comment threadsrc/Forms/Form.php Outdated
…trictions
# Conflicts:
#	resources/js/pages/forms/Index.vue
@jasonvarga
jasonvarga merged commit 56e9900 into forms-2Jul 7, 2026
19 checks passed
@jasonvarga
jasonvarga deleted the forms-2-access-restrictions branch July 7, 2026 19:32
@duncanmccleanduncanmcclean mentioned this pull request Jul 23, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@duncanmcclean@jasonvarga