Configuration
FilaForms ships with sensible defaults. Publish the config file and adjust settings to match your application.
Publish Commands
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:
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:
use FilaForms\Core\Facades\Features;
use FilaForms\Core\Enums\FilaFormsFeature;
if (Features::enabled(FilaFormsFeature::ANALYTICS)) {
// Analytics is active
}
Available Features
| Feature | Description | Default |
|---|---|---|
NOTIFICATIONS_EMAIL_ADMIN | Send email to admin on new submission | Enabled |
NOTIFICATIONS_EMAIL_AUTO_RESPONSE | Send confirmation email to respondent | Enabled |
NOTIFICATIONS_IN_APP | In-app notification on new submission | Enabled |
FIELD_UI_WIDTH_CONTROL | Allow per-field width configuration | Enabled |
FIELD_CONDITIONAL_VISIBILITY | Conditional field visibility rules | Disabled |
ANALYTICS | Form analytics and submission tracking | Enabled |
INTEGRATIONS | Third-party integrations | Disabled |
PUBLIC_FORMS | Publicly accessible form URLs | Enabled |
MULTI_TENANCY | Multi-tenant form scoping | Disabled |
SUBMISSION_SEQUENTIAL_NUMBER | Auto-incrementing submission numbers | Enabled |
Database Tables
FilaForms uses three tables. Names are configurable:
'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:
'storage' => [
'disk' => env('FILA_FORMS_STORAGE_DISK', 'local'),
'path' => 'form-submissions',
],
public and run php artisan storage:link.Routes
Public form routes are registered automatically. Forms are accessed via ULID at /filaforms/{ulid}.
'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.
'security' => [
'honeypot' => [
'enabled' => true,
'field_name' => 'website',
],
],
Notifications
Configure admin notification recipients and sender details:
'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:
'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:
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:
'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:
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:
'forms' => [
'section_type' => 'section', // 'section', 'fieldset', or 'headless'
],
Display Formats
Configure default display formats for date, datetime, and phone fields:
'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:
// 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:
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:
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
| Variable | Default | Description |
|---|---|---|
FILA_FORMS_STORAGE_DISK | local | Filesystem disk for file uploads |
FILA_FORMS_FROM_EMAIL | MAIL_FROM_ADDRESS | Sender email for notifications |
FILA_FORMS_FROM_NAME | MAIL_FROM_NAME | Sender name for notifications |