Getting Started

Configuration

Configure feature flags, storage, security, routes, and multi-tenancy.

FilaForms ships with sensible defaults. Publish the config file and adjust settings to match your application.

Publish Commands

Terminal
php artisan vendor:publish --tag="filaforms-config"
php artisan vendor:publish --tag="filaforms-views"
php artisan vendor:publish --tag="filaforms-translations"

Feature Flags

The FilaFormsFeature enum controls optional functionality. Configure features in config/filaforms.php using the FeatureConfigurator:

config/filaforms.php
use FilaForms\Core\Enums\FilaFormsFeature;
use FilaForms\Core\FeatureSystem\FeatureConfigurator;

'features' => FeatureConfigurator::configure()
    ->enable(
        FilaFormsFeature::NOTIFICATIONS_EMAIL_ADMIN,
        FilaFormsFeature::NOTIFICATIONS_EMAIL_AUTO_RESPONSE,
        FilaFormsFeature::NOTIFICATIONS_IN_APP,
        FilaFormsFeature::FIELD_UI_WIDTH_CONTROL,
        FilaFormsFeature::ANALYTICS,
        FilaFormsFeature::PUBLIC_FORMS,
    )
    ->disable(
        FilaFormsFeature::MULTI_TENANCY,
    ),

Check feature status at runtime:

app/Http/Controllers/ExampleController.php
use FilaForms\Core\Facades\Features;
use FilaForms\Core\Enums\FilaFormsFeature;

if (Features::enabled(FilaFormsFeature::ANALYTICS)) {
    // Analytics is active
}

Available Features

FeatureDescriptionDefault
NOTIFICATIONS_EMAIL_ADMINSend email to admin on new submissionEnabled
NOTIFICATIONS_EMAIL_AUTO_RESPONSESend confirmation email to respondentEnabled
NOTIFICATIONS_IN_APPIn-app notification on new submissionEnabled
FIELD_UI_WIDTH_CONTROLAllow per-field width configurationEnabled
FIELD_CONDITIONAL_VISIBILITYConditional field visibility rulesDisabled
ANALYTICSForm analytics and submission trackingEnabled
INTEGRATIONSThird-party integrationsDisabled
PUBLIC_FORMSPublicly accessible form URLsEnabled
MULTI_TENANCYMulti-tenant form scopingDisabled
SUBMISSION_SEQUENTIAL_NUMBERAuto-incrementing submission numbersEnabled

Database Tables

FilaForms uses three tables. Names are configurable:

config/filaforms.php
'database' => [
    'table_names' => [
        'forms' => 'forms',
        'form_submissions' => 'form_submissions',
        'form_events' => 'form_events',
    ],
    'column_names' => [
        'tenant_foreign_key' => 'tenant_id',
    ],
],

Storage

File uploads are stored using Laravel's filesystem. Configure the disk and path:

config/filaforms.php
'storage' => [
    'disk' => env('FILA_FORMS_STORAGE_DISK', 'local'),
    'path' => 'form-submissions',
],
For public file access (e.g., downloadable uploads), set the disk to public and run php artisan storage:link.

Routes

Public form routes are registered automatically. Forms are accessed via ULID at /filaforms/{ulid}.

config/filaforms.php
'routes' => [
    'enabled' => true,
    'prefix' => 'filaforms',
    'middleware' => ['web'],
    'domain' => null,
],

Set enabled to false to disable public form routes entirely. Use domain to restrict routes to a specific domain.

Security

Honeypot spam protection is enabled by default. A hidden field is added to public forms and submissions containing a value are rejected.

config/filaforms.php
'security' => [
    'honeypot' => [
        'enabled' => true,
        'field_name' => 'website',
    ],
],

Notifications

Configure admin notification recipients and sender details:

config/filaforms.php
'notifications' => [
    'admin_emails' => [
        'admin@example.com',
        'team@example.com',
    ],
    'from_email' => env('FILA_FORMS_FROM_EMAIL', env('MAIL_FROM_ADDRESS')),
    'from_name' => env('FILA_FORMS_FROM_NAME', env('MAIL_FROM_NAME')),
],

Field Types

Control which field types are available in the form builder. Use enabled as a whitelist or disabled as a blacklist:

config/filaforms.php
'field_types' => [
    'enabled' => [
        // Empty array = all field types enabled (default)
        // 'text', 'textarea', 'select', 'checkbox', 'number',
    ],
    'disabled' => [
        // 'rich-editor', 'markdown-editor',
    ],
],

You can also restrict field types per panel via the plugin registration:

app/Providers/Filament/AdminPanelProvider.php
FilaFormsPlugin::make()
    ->onlyFieldTypes(['text', 'textarea', 'select', 'number', 'email']),

Multi-Tenancy

Enable the Feature Flag

Add FilaFormsFeature::MULTI_TENANCY to your enabled features in config/filaforms.php.

Configure the Tenant Key

Set the foreign key column name used to scope forms:

config/filaforms.php
'database' => [
    'column_names' => [
        'tenant_foreign_key' => 'tenant_id',
    ],
],

Tenant Resolution

The current tenant is resolved automatically from the Filament panel. Forms are scoped to the active tenant -- no additional configuration is needed.

Custom Models

Override the default Eloquent models if you need to extend form, submission, or event behavior:

app/Providers/AppServiceProvider.php
use FilaForms\Core\Facades\FilaForms;
use App\Models\CustomForm;
use App\Models\CustomSubmission;
use App\Models\CustomEvent;

public function boot(): void
{
    FilaForms::useFormModel(CustomForm::class);
    FilaForms::useSubmissionModel(CustomSubmission::class);
    FilaForms::useEventModel(CustomEvent::class);
}

Default Section Type

Control the default visual wrapper for form sections:

config/filaforms.php
'forms' => [
    'section_type' => 'section', // 'section', 'fieldset', or 'headless'
],

Display Formats

Configure default display formats for date, datetime, and phone fields:

config/filaforms.php
'formats' => [
    'date' => 'Y-m-d',
    'datetime' => 'Y-m-d H:i:s',
    'time' => 'H:i',
    'phone' => [
        'pattern' => '/^\d{10}$/',
        'mask' => '(999) 999-9999',
        'placeholder' => '(XXX) XXX-XXXX',
    ],
],

Date and datetime formats control the display format in the date picker. The storage format is always Y-m-d / Y-m-d H:i:s regardless of display setting.

Phone configuration controls the input mask, placeholder text, and server-side validation pattern. The default validates US 10-digit numbers. Customize for other locales:

config/filaforms.php
// UK phone format
'phone' => [
    'pattern' => '/^\d{11}$/',
    'mask' => '99999 999999',
    'placeholder' => 'XXXXX XXXXXX',
],

Runtime Overrides

For multi-tenant applications where formats vary per tenant, use plugin methods to override at runtime:

app/Providers/AppServiceProvider.php
use FilaForms\Core\FilaFormsPlugin;

public function boot(): void
{
    $plugin = FilaFormsPlugin::make();

    $plugin->dateFormatUsing(fn (): string => app(SiteSettings::class)->date_format ?: 'm/d/Y');
    $plugin->dateTimeFormatUsing(fn (): string => app(SiteSettings::class)->datetime_format ?: 'm/d/Y H:i');
}

Plugin closures take priority over config values.

Form URL Resolution

FilaForms generates URLs to forms in notifications, integration details, and other contexts. By default, it auto-detects the Filament resource URL. For standalone (non-panel) applications, register a custom URL resolver:

app/Providers/AppServiceProvider.php
use FilaForms\Core\FilaFormsPlugin;
use FilaForms\Core\Models\Form;

public function boot(): void
{
    $plugin = FilaFormsPlugin::make();

    $plugin->formUrlUsing(fn (Form $form, array $query): string => route('app.forms.view', [
        'team' => $form->team->slug,
        'form' => $form,
    ] + $query));
}

When no resolver is registered, FilaForms tries FormResource::getUrl() automatically. If that fails (e.g., outside a panel context), URLs gracefully degrade to null and links render as plain text.

Environment Variables

VariableDefaultDescription
FILA_FORMS_STORAGE_DISKlocalFilesystem disk for file uploads
FILA_FORMS_FROM_EMAILMAIL_FROM_ADDRESSSender email for notifications
FILA_FORMS_FROM_NAMEMAIL_FROM_NAMESender name for notifications
Copyright © 2026