24
Forms Engine

Form DSL Reference

Code-first builder methods for fields, validation, publication settings, and file options.

Main builder

  • Form::define('key')
  • ->title('...')
  • ->version('1')
  • ->category('...')
  • ->published(true|false)
  • ->unpublished(true|false)

Field methods

  • text, number
  • radio, checkboxGroup
  • consent
  • temporal
  • date, time as convenience aliases for temporal(...)
  • file
  • address
Prefer temporal(...) in new code. The date(...) and time(...) helpers remain as convenience aliases for existing codebases.

Common field options

  • required(bool = true)
  • default(mixed)
  • label(string)
  • placeholder(string)
  • helpText(string)
  • rules(string|array ...$rules)
  • replaceRules(string|array ...$rules)
  • meta(array)
  • min(...), max(...), step(...)
  • options(array)
  • multiple(bool = true)
  • disabled(bool = true)

Publication settings

These values are stored on the form definition and are consumed by the runtime and HTTP API:

  • publish_at
  • pause_at
  • response_limit
  • submission_code_required
  • submission_code

public_url is read-only and is resolved at response time by the backend public-link resolver.

File field options

  • accept(string|array)
  • maxSize(int)
  • maxFiles(int)
  • storageDisk(string)
  • storageDirectory(string)
  • visibility('public'|'private')