Configuration

Complete reference for Polyform configuration options

Everything in Polyform is configured through config/polyform.php. This page covers every available option.

Table Prefix

Change the database table prefix if the default conflicts with your existing tables:

config/polyform.php
KeyTypeDefaultDescription
table_prefixstringpolyform_Prefix for all Polyform database tables (forms, form_fields, etc.)

Model Classes

All models are referenced through config, so you can swap in your own subclasses whenever you need custom behavior:

config/polyform.php
KeyDefault ClassDescription
formPolyform\Models\FormMain form model
form_fieldPolyform\Models\FormFieldIndividual field definition
form_stepPolyform\Models\FormStepMulti-step form steps
form_submissionPolyform\Models\FormSubmissionSubmitted form data
form_submission_fieldPolyform\Models\FormSubmissionFieldIndividual submission field values
form_field_optionPolyform\Models\FormFieldOptionStatic options for select/radio/checkbox fields
form_webhookPolyform\Models\FormWebhookWebhook configurations
form_webhook_deliveryPolyform\Models\FormWebhookDeliveryWebhook delivery logs
form_exportPolyform\Models\FormExportExport job tracking
config/polyform.php

File Storage

Controls where uploaded files go and what's allowed:

KeyTypeDefaultDescription
files.diskstringpublicLaravel filesystem disk for storing uploads
files.pathstringpolyform-uploadsDirectory path within the disk
files.max_size_kbint10240Maximum file size in KB (default: 10MB)
files.allowed_extensionsarrayjpg, png, pdf, docx, xlsx, etc.Allowed file extensions (26 common types)
KeyTypeDefaultDescription
file_storage_handlerstringPolyform\Services\LocalFileStorageHandlerClass implementing FileStorageHandler interface

Submission Tracking

Choose what metadata gets stored with each submission:

KeyTypeDefaultDescription
submissions.track_ipbooltrueStore submitter IP address
submissions.track_user_agentbooltrueStore submitter browser user agent
submissions.prune_after_daysint|nullnullAuto-delete submissions after N days (null = never)

Caching

Polyform caches form structures and submission counts to keep things fast:

KeyTypeDefaultDescription
cache.enabledbooltrueEnable form structure caching
cache.ttlint3600Cache TTL in seconds (default: 1 hour)
cache.prefixstringpolyformCache key prefix

Rich Text Editor

Settings for the rich text field (built on Tiptap):

KeyTypeDefaultDescription
rich_text.allowed_extensionsarray[Bold, Italic, Underline, Strike, Link, etc.]Tiptap extensions to enable
rich_text.max_lengthint|nullnullMaximum character count (null = unlimited)

Rating Field Defaults

Defaults applied to rating fields:

KeyTypeDefaultDescription
rating.maxint5Default maximum rating value
rating.iconstringstarIcon to display (star, heart, thumb)

Scale Field Defaults

Defaults for scale fields (e.g., a 1-10 slider):

KeyTypeDefaultDescription
scale.minint1Default minimum value
scale.maxint10Default maximum value
scale.stepint1Default step increment

Multi-Step Forms

Controls how multi-step forms behave:

KeyTypeDefaultDescription
steps.validate_on_nextbooltrueValidate current step before advancing
steps.show_progressbooltrueDisplay progress indicator
steps.allow_backbooltrueAllow navigating to previous steps

Autosave

Automatic draft saving settings:

KeyTypeDefaultDescription
autosave.enabledboolfalseEnable autosave for drafts
autosave.intervalint30000Autosave interval in milliseconds (default: 30s)

Webhooks

Webhook dispatching and security settings:

KeyTypeDefaultDescription
webhooks.enabledbooltrueEnable webhook dispatching
webhooks.queuestringdefaultQueue name for webhook jobs
webhooks.timeoutint10HTTP request timeout in seconds
webhooks.max_retriesint3Maximum retry attempts on failure
webhooks.signing_secretstring|nullenv(POLYFORM_WEBHOOK_SECRET)Secret for HMAC signature verification
webhooks.signature_headerstringX-Polyform-SignatureHTTP header name for signature

Data Exports

Settings for exporting submission data:

KeyTypeDefaultDescription
exports.diskstringlocalFilesystem disk for storing exports
exports.pathstringpolyform-exportsDirectory path within the disk
exports.formatsarray[csv, json, xlsx]Supported export formats
exports.chunk_sizeint1000Process submissions in chunks (memory optimization)
exports.prune_after_daysint7Auto-delete export files after N days

Option Sources

Register where select, radio and checkbox fields pull their options from:

Enum Sources

Map PHP enums to option sources:

KeyDescription
option_sources.enumsArray mapping source keys to enum class names (e.g., 'user_roles' => UserRole::class)

Model Sources

Load options from Eloquent models:

KeyDescription
option_sources.modelsArray mapping source keys to model class names (e.g., 'countries' => Country::class)

Custom Resolvers

Register custom option resolvers that implement DynamicOptionResolver:

KeyDescription
option_sources.resolversArray mapping source keys to resolver class names implementing DynamicOptionResolver

Environment Variables

A few config values can be set directly via your .env file:

VariableConfig KeyDefault
POLYFORM_TABLE_PREFIXpolyform.table_prefixpolyform_
POLYFORM_CACHE_ENABLEDpolyform.cache.enabledtrue
POLYFORM_WEBHOOK_SECRETpolyform.webhooks.signing_secretnull
POLYFORM_EXPORTS_DISKpolyform.exports.disklocal