### Manually Install Integrations Source: https://docs.filaforms.app/integrations/setup Alternative manual installation steps for publishing configuration and migrations, followed by running the migration. ```bash php artisan vendor:publish --tag="filaforms-integrations-config" php artisan vendor:publish --tag="filaforms-integrations-migrations" php artisan migrate ``` -------------------------------- ### Install FilaForms via Artisan Source: https://docs.filaforms.app/getting-started/installation Executes the one-step installation command to publish configuration and migrations. ```bash php artisan filaforms:install ``` -------------------------------- ### Run the Integration Install Command Source: https://docs.filaforms.app/integrations/setup Executes the installation command to publish configuration files and run necessary database migrations. ```bash php artisan filaforms-integrations:install ``` -------------------------------- ### Install FilaForms Package Source: https://docs.filaforms.app/getting-started/installation Run this command in your terminal to install the core package. The -W flag is required to allow dependency resolution updates. ```bash composer require filaforms/core -W ``` -------------------------------- ### Install Laravel Passport Migrations Source: https://docs.filaforms.app/integrations/zapier Publish and run the necessary migrations for Laravel Passport. ```bash php artisan vendor:publish --tag=passport-migrations php artisan migrate ``` -------------------------------- ### Install the Integrations Package Source: https://docs.filaforms.app/integrations/setup Use Composer to add the FilaForms integrations package to your project. ```bash composer require filaforms/integrations ``` -------------------------------- ### Customize Phone Format for Locales Source: https://docs.filaforms.app/getting-started/configuration Example configuration for a UK phone format using a different pattern, mask, and placeholder. ```php // UK phone format 'phone' => [ 'pattern' => '/^\d{11}$/', 'mask' => '99999 999999', 'placeholder' => 'XXXXX XXXXXX', ], ``` -------------------------------- ### GET /filaforms/connections/oauth/redirect/{connection} Source: https://docs.filaforms.app/integrations/google-sheets Initiates the Google OAuth flow for a specific connection. ```APIDOC ## GET /filaforms/connections/oauth/redirect/{connection} ### Description Starts the Google OAuth flow to authenticate the user's Google account. ### Method GET ### Endpoint /filaforms/connections/oauth/redirect/{connection} ### Parameters #### Path Parameters - **connection** (string) - Required - The identifier for the connection. ``` -------------------------------- ### GET /filaforms/connections/oauth/callback Source: https://docs.filaforms.app/integrations/google-sheets Handles the OAuth callback from Google. ```APIDOC ## GET /filaforms/connections/oauth/callback ### Description Processes the OAuth callback response from Google to complete the authentication flow. ### Method GET ### Endpoint /filaforms/connections/oauth/callback ``` -------------------------------- ### GET /filaforms/connections/stripe/callback Source: https://docs.filaforms.app/integrations/stripe The return URL used by Stripe after the account onboarding process is completed. ```APIDOC ## GET /filaforms/connections/stripe/callback ### Description Handles the redirect from Stripe after a user completes the account onboarding process. ### Method GET ### Endpoint /filaforms/connections/stripe/callback ``` -------------------------------- ### GET /filaforms/google-sheets/picker/{connection} Source: https://docs.filaforms.app/integrations/google-sheets Opens the Google Drive Picker popup for spreadsheet selection. ```APIDOC ## GET /filaforms/google-sheets/picker/{connection} ### Description Triggers the Google Drive Picker popup to allow the user to select a spreadsheet for the integration. ### Method GET ### Endpoint /filaforms/google-sheets/picker/{connection} ### Parameters #### Path Parameters - **connection** (string) - Required - The identifier for the connection. ``` -------------------------------- ### GET /api/filaforms/automations/forms Source: https://docs.filaforms.app/integrations/zapier List all forms associated with the user. ```APIDOC ## GET /api/filaforms/automations/forms ### Description Retrieve a list of the user's forms. ### Method GET ### Endpoint /api/filaforms/automations/forms ``` -------------------------------- ### GET /api/filaforms/automations/auth/test Source: https://docs.filaforms.app/integrations/zapier Test the authentication status. ```APIDOC ## GET /api/filaforms/automations/auth/test ### Description Test the current authentication status. ### Method GET ### Endpoint /api/filaforms/automations/auth/test ``` -------------------------------- ### Submission Data Structure Source: https://docs.filaforms.app/core-features/submissions Example of the JSON structure stored in the submission data column. ```json { "custom_fields": { "name": "Jane Doe", "email": "jane@example.com", "category": ["option1", "option2"] } } ``` -------------------------------- ### $form->getAnalytics() Source: https://docs.filaforms.app/core-features/analytics Retrieves a summary of form engagement metrics including views, starts, submissions, completion rate, and average time to complete. ```APIDOC ## $form->getAnalytics() ### Description Retrieves a summary of form engagement metrics including views, starts, submissions, completion rate, and average time to complete. ### Returns - **views** (int) - Unique sessions that loaded the form - **starts** (int) - Unique sessions that began filling the form - **submissions** (int) - Unique sessions that completed and submitted the form - **completion_rate** (float) - Percentage of starts that resulted in submissions - **avg_time_to_complete** (int) - Average duration from first interaction to submission in seconds ``` -------------------------------- ### Retrieve Form Summary Analytics Source: https://docs.filaforms.app/core-features/analytics Fetches an associative array containing aggregated metrics like views, starts, submissions, completion rate, and average completion time. ```php $analytics = $form->getAnalytics(); // Returns: // [ // 'views' => 1250, // 'starts' => 840, // 'submissions' => 620, // 'completion_rate' => 73.8, // 'avg_time_to_complete' => 45, // ] ``` -------------------------------- ### Auto-Response Email Template Source: https://docs.filaforms.app/core-features/notifications Example of an auto-response message body using merge tags to personalize content. ```text Hello {{ name }}, Thank you for submitting "{{ form_name }}". We received your message about {{ subject }} and will respond shortly. ``` -------------------------------- ### Run Migrations Source: https://docs.filaforms.app/getting-started/installation Execute migrations to create the necessary database tables. Optionally publish migrations first if you need to customize column types. ```bash php artisan migrate ``` ```bash php artisan vendor:publish --tag="filaforms-migrations" ``` -------------------------------- ### Create Symbolic Link Source: https://docs.filaforms.app/core-features/file-uploads Run this command to make the public storage directory accessible via the web. ```bash php artisan storage:link ``` -------------------------------- ### GET /api/filaforms/automations/submissions Source: https://docs.filaforms.app/integrations/zapier Poll recent form submissions. ```APIDOC ## GET /api/filaforms/automations/submissions ### Description Poll recent submissions for the user's forms. ### Method GET ### Endpoint /api/filaforms/automations/submissions ``` -------------------------------- ### Publish Configuration and Enable Multi-Tenancy Source: https://docs.filaforms.app/getting-started/installation Publish the configuration file and enable the multi-tenancy feature before running migrations. ```bash php artisan vendor:publish --tag="filaforms-config" ``` ```php 'features' => FeatureConfigurator::configure() ->enable(FilaFormsFeature::MULTI_TENANCY) ``` -------------------------------- ### POST /filaforms/connections/stripe/connect/{connection} Source: https://docs.filaforms.app/integrations/stripe Initiates the Stripe onboarding process for a specific connection. ```APIDOC ## POST /filaforms/connections/stripe/connect/{connection} ### Description Starts the Stripe onboarding flow for the specified connection. ### Method POST ### Endpoint /filaforms/connections/stripe/connect/{connection} ### Parameters #### Path Parameters - **connection** (string) - Required - The unique identifier for the Stripe connection. ``` -------------------------------- ### Publish and Run Migrations Manually Source: https://docs.filaforms.app/getting-started/installation Workaround for older versions where migrations were not auto-loaded. ```bash php artisan vendor:publish --tag="filaforms-migrations" php artisan migrate ``` -------------------------------- ### Implement Form Storage Patterns Source: https://docs.filaforms.app/advanced/standalone-components Demonstrates common methods for persisting form JSON data to a database, file system, or cache. ```php // Database table DB::table('my_forms')->insert([ 'form_json' => json_encode($formData), 'created_by' => auth()->id(), ]); // JSON file Storage::put("forms/{$formId}.json", json_encode($formData)); // Cache (temporary) Cache::put("form:{$formId}", $formData, now()->addHours(24)); ``` -------------------------------- ### Register Local Development Redirect URI Source: https://docs.filaforms.app/integrations/google-sheets The callback URL required for local development using fwd.host. ```text https://fwd.host/http://your-site.test/filaforms/connections/oauth/callback ``` -------------------------------- ### Run Database Migrations Source: https://docs.filaforms.app/getting-started/installation Executes pending database migrations to ensure the required tables exist. ```bash php artisan migrate ``` -------------------------------- ### Form List Polling URL Source: https://docs.filaforms.app/integrations/zapier The GET endpoint used for the Form List polling trigger. ```http GET https://{domain}/api/filaforms/automations/forms ``` -------------------------------- ### Set Zapier Environment Variables Source: https://docs.filaforms.app/integrations/zapier Add the Client ID and Client Secret to your .env file. ```text ZAPIER_CLIENT_ID=your_client_id ZAPIER_CLIENT_SECRET=your_client_secret ``` -------------------------------- ### Implement Runtime Format Overrides Source: https://docs.filaforms.app/getting-started/configuration Uses plugin methods in a service provider to dynamically override formats, which take priority over static configuration values. ```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'); } ``` -------------------------------- ### Publish FilaForms Assets Source: https://docs.filaforms.app/getting-started/configuration Commands to publish configuration, views, and translations to the application. ```bash php artisan vendor:publish --tag="filaforms-config" php artisan vendor:publish --tag="filaforms-views" php artisan vendor:publish --tag="filaforms-translations" ``` -------------------------------- ### Configure File Storage Source: https://docs.filaforms.app/core-features/file-uploads Define the storage disk and base directory in the configuration file. ```php 'storage' => [ 'disk' => env('FILA_FORMS_STORAGE_DISK', 'local'), 'path' => 'form-submissions', ], ``` -------------------------------- ### Configure Public Form Routes Source: https://docs.filaforms.app/core-features/public-forms Define the route prefix, middleware, and domain for public forms in the configuration file. ```php 'routes' => [ 'prefix' => 'filaforms', 'middleware' => ['web'], 'domain' => null, ], ``` -------------------------------- ### Initialize OAuth Token Data Source: https://docs.filaforms.app/integrations/oauth Create an OAuthTokenData object to structure token information before storage. ```php use FilaForms\Integrations\Data\OAuthTokenData; $tokenData = OAuthTokenData::from([ 'accessToken' => 'ya29.a0...', 'refreshToken' => '1//0e...', 'expiresAt' => now()->addHour(), 'scopes' => ['https://www.googleapis.com/auth/spreadsheets'], ]); ``` -------------------------------- ### Configure Global Notification Settings Source: https://docs.filaforms.app/core-features/notifications Define default sender information and admin email addresses in the application configuration file. ```php 'notifications' => [ 'from_email' => env('FILA_FORMS_FROM_EMAIL'), 'from_name' => env('FILA_FORMS_FROM_NAME'), 'admin_emails' => [ 'team@example.com', ], ], ``` ```php 'notifications' => [ 'from_email' => env('FILA_FORMS_FROM_EMAIL', 'noreply@example.com'), 'from_name' => env('FILA_FORMS_FROM_NAME', 'My App'), 'admin_emails' => [ 'admin@example.com', ], ], ``` -------------------------------- ### Register Production Redirect URI Source: https://docs.filaforms.app/integrations/google-sheets The exact callback URL required for production OAuth authentication. ```text https://your-domain.com/filaforms/connections/oauth/callback ``` -------------------------------- ### Configure Standalone Wizard Form JSON Source: https://docs.filaforms.app/core-features/multi-step-forms Define a wizard-mode form using a JSON schema by setting the display_mode to wizard within the experience settings. ```json { "settings": { "experience": { "display_mode": "wizard", "allow_step_navigation": true, "submit_button_text": "Submit Application" } }, "schema": { "sections": [ { "id": "sec_1", "name": "Step 1 Title", "...": "..." }, { "id": "sec_2", "name": "Step 2 Title", "...": "..." } ] } } ``` -------------------------------- ### Configure Google Sheets Environment Variables Source: https://docs.filaforms.app/integrations/configuration Enable Google Sheets integration and provide OAuth credentials in your .env file. ```env FILAFORMS_GOOGLE_SHEETS_ENABLED=true FILAFORMS_GOOGLE_CLIENT_ID=your-id.apps.googleusercontent.com FILAFORMS_GOOGLE_CLIENT_SECRET=your-secret FILAFORMS_GOOGLE_API_KEY=your-api-key ``` -------------------------------- ### Create Passport OAuth Client Source: https://docs.filaforms.app/integrations/zapier Create a new OAuth client for Zapier using the provided redirect URI. ```bash php artisan passport:client --name="Zapier" --redirect_uri="https://zapier.com/dashboard/auth/oauth/return/App{ID}CLIAPI/" ``` -------------------------------- ### Configure Stripe Environment Variables Source: https://docs.filaforms.app/integrations/configuration Define Stripe API keys, webhook secrets, and fee settings in your .env file. ```env FILAFORMS_STRIPE_SECRET_KEY=sk_live_... FILAFORMS_STRIPE_PUBLISHABLE_KEY=pk_live_... FILAFORMS_STRIPE_WEBHOOK_SECRET=whsec_... FILAFORMS_STRIPE_FEE_PERCENT=2 FILAFORMS_STRIPE_CURRENCY=USD ``` -------------------------------- ### Configure Default Section Type Source: https://docs.filaforms.app/getting-started/configuration Sets the default visual wrapper for form sections in the configuration file. ```php 'forms' => [ 'section_type' => 'section', // 'section', 'fieldset', or 'headless' ], ``` -------------------------------- ### Configure Default Display Formats Source: https://docs.filaforms.app/getting-started/configuration Defines default formats for date, datetime, time, and phone fields. ```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', ], ], ``` -------------------------------- ### Integration Directory Structure Source: https://docs.filaforms.app/integrations/creating-integrations The required file system layout for the auto-discovery feature to register integrations. ```text src/Integrations/ Payments/ EmailMarketing/ <- MailchimpIntegration goes here CRM/ <- SalesforceIntegration goes here Storage/ Webhook/ Automation/ Shared/ <- Base classes (don't put integrations here) ``` -------------------------------- ### Configure Stripe Environment Variables Source: https://docs.filaforms.app/integrations/stripe Required environment variables for Stripe integration. Use test keys for development and live keys for production. ```text FILAFORMS_STRIPE_SECRET_KEY=sk_test_... FILAFORMS_STRIPE_PUBLISHABLE_KEY=pk_test_... FILAFORMS_STRIPE_WEBHOOK_SECRET=whsec_... FILAFORMS_STRIPE_FEE_PERCENT=2 FILAFORMS_STRIPE_CURRENCY=USD ``` -------------------------------- ### Register a custom URL resolver Source: https://docs.filaforms.app/getting-started/configuration Use this in the boot method of a service provider to define how form URLs are generated in non-panel applications. ```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)); } ``` -------------------------------- ### Include CSS Assets Source: https://docs.filaforms.app/getting-started/installation Add the plugin views to your Filament theme CSS file to ensure proper styling. ```css @source "../../../../vendor/filaforms/core/resources/views/**/*.blade.php"; ``` -------------------------------- ### Check Feature Status at Runtime Source: https://docs.filaforms.app/getting-started/configuration Use the Features facade to verify if a specific feature is enabled during application execution. ```php use FilaForms\Core\Facades\Features; use FilaForms\Core\Enums\FilaFormsFeature; if (Features::enabled(FilaFormsFeature::ANALYTICS)) { // Analytics is active } ``` -------------------------------- ### Define Directory Structure Source: https://docs.filaforms.app/core-features/file-uploads The path pattern used for organizing uploaded files. ```text form-submissions/{form-id}/{field-code}/{ulid}.{ext} ``` -------------------------------- ### Configure Tenant Foreign Key Source: https://docs.filaforms.app/getting-started/configuration Define the database column name used for scoping forms in multi-tenant environments. ```php 'database' => [ 'column_names' => [ 'tenant_foreign_key' => 'tenant_id', ], ], ``` -------------------------------- ### OAuth Route Definitions Source: https://docs.filaforms.app/integrations/oauth The standard routes used to initiate the OAuth flow and handle the provider callback. ```text GET /filaforms/connections/oauth/redirect/{connection} -> Start OAuth flow GET /filaforms/connections/oauth/callback -> Handle callback ``` -------------------------------- ### Configure Auth Guard for Passport Source: https://docs.filaforms.app/integrations/zapier Update the guards configuration in config/auth.php to use the passport driver. ```php 'guards' => [ 'web' => [ 'driver' => 'session', 'provider' => 'users', ], 'api' => [ 'driver' => 'passport', 'provider' => 'users', ], ], ``` -------------------------------- ### Handle Form Submissions Source: https://docs.filaforms.app/advanced/standalone-components Listen for the form-submitted event in a Livewire component to process submission data. ```php use Livewire\Attributes\On; use Livewire\Component; class PublicFormPage extends Component { public string $formSchema; #[On('form-submitted')] public function handleSubmission(array $submissionData): void { DB::table('form_submissions')->insert([ 'form_id' => $submissionData['form_id'], 'data' => json_encode($submissionData['fields']), 'submitted_at' => now(), ]); session()->flash('message', 'Thank you for your submission!'); } } ``` -------------------------------- ### Extend GenericApiIntegration for API-based integrations Source: https://docs.filaforms.app/integrations/creating-integrations Implement a custom integration class by extending GenericApiIntegration to handle API authentication and data submission. ```php config['list_id']; $dc = $integration->config['data_center']; return "https://{$dc}.api.mailchimp.com/3.0/lists/{$listId}/members"; } public function getAuthHeaders(IntegrationConnection $connection): array { return [ 'Authorization' => 'Bearer ' . $connection->credentials['api_key'], ]; } protected function buildPayload(array $mappedData): array { return [ 'email_address' => $mappedData['email'] ?? '', 'status' => 'subscribed', 'merge_fields' => collect($mappedData) ->except('email') ->toArray(), ]; } public function getFieldMappingSchema(): array { return [ 'email' => ['label' => 'Email Address', 'required' => true], 'FNAME' => ['label' => 'First Name'], 'LNAME' => ['label' => 'Last Name'], ]; } } ``` -------------------------------- ### Define Environment Variables Source: https://docs.filaforms.app/core-features/notifications Set default sender identity using environment variables. ```env FILA_FORMS_FROM_EMAIL=noreply@example.com FILA_FORMS_FROM_NAME="My App" ``` -------------------------------- ### Configure Auto-Discovery Source: https://docs.filaforms.app/integrations/setup Disable automatic integration class discovery in the configuration file. ```php 'auto_discover' => false, ``` -------------------------------- ### Implement Salesforce OAuth Integration Source: https://docs.filaforms.app/integrations/creating-integrations Extend GenericOAuthIntegration to define Salesforce-specific OAuth endpoints, scopes, and credentials. ```php tokenManager->getValidToken($connection); return [ 'Authorization' => 'Bearer ' . $token, ]; } ``` -------------------------------- ### Upgrade FilaForms Package Source: https://docs.filaforms.app/getting-started/installation Updates the package dependencies and runs necessary migrations and upgrade tasks. ```bash composer update filaforms/core -W php artisan migrate php artisan filaforms:upgrade ``` -------------------------------- ### Configure Admin Tables Source: https://docs.filaforms.app/advanced/events-and-hooks Customize the behavior of forms and submissions tables in the admin panel. ```php FilaFormsPlugin::make() ->configureFormsTable(function ($table) { return $table->defaultSort('created_at', 'desc'); }) ->configureSubmissionsTable(function ($table) { return $table->poll('10s'); }); ``` -------------------------------- ### Configure OAuth Callback URL Source: https://docs.filaforms.app/integrations/configuration Set a custom OAuth callback URL for local development environments using tunneling services. ```env FILAFORMS_OAUTH_CALLBACK_URL=https://fwd.host/http://your-site.test/filaforms/connections/oauth/callback ``` -------------------------------- ### Configure Database Table Names Source: https://docs.filaforms.app/getting-started/configuration Define custom table and column names for FilaForms database operations. ```php 'database' => [ 'table_names' => [ 'forms' => 'forms', 'form_submissions' => 'form_submissions', 'form_events' => 'form_events', ], 'column_names' => [ 'tenant_foreign_key' => 'tenant_id', ], ], ``` -------------------------------- ### Create Form Component Logic Source: https://docs.filaforms.app/advanced/standalone-components Handles form updates via events and persists the form structure to the database. ```php use Livewire\Attributes\On; use Livewire\Component; class FormCreator extends Component { public ?array $formData = null; #[On('form-updated')] public function onFormUpdated(array $formData): void { $this->formData = $formData; } public function save() { $id = DB::table('my_forms')->insertGetId([ 'json_structure' => json_encode($this->formData), 'created_at' => now(), ]); return redirect("/forms/{$id}/preview"); } public function render() { return view('livewire.form-creator'); } } ``` -------------------------------- ### Define Field Mapping Defaults Source: https://docs.filaforms.app/integrations/configuration Set global field mapping behavior in the filaforms-integrations.php configuration file. ```php 'field_mapping' => [ 'include_unmapped_fields' => false, 'default_transformation' => 'none', ], ``` -------------------------------- ### Generate Passport Encryption Keys Source: https://docs.filaforms.app/integrations/zapier Generate the encryption keys required for Passport to function. ```bash php artisan passport:keys ``` -------------------------------- ### Register FilaForms Plugin Source: https://docs.filaforms.app/getting-started/installation Add the FilaFormsPlugin to your Filament panel provider to activate the plugin. ```php use FilaForms\Core\FilaFormsPlugin; $panel ->plugins([ FilaFormsPlugin::make(), ]); ``` -------------------------------- ### Create Form View Template Source: https://docs.filaforms.app/advanced/standalone-components Renders the form builder component and a save button. ```blade
``` -------------------------------- ### Configure Feature Flags Source: https://docs.filaforms.app/getting-started/configuration Enable or disable specific features within the config/filaforms.php file using the FeatureConfigurator. ```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, ) ->disable( FilaFormsFeature::MULTI_TENANCY, ), ``` -------------------------------- ### Set Storage Disk Environment Variable Source: https://docs.filaforms.app/core-features/file-uploads Update the environment variable to change the storage disk to public. ```env FILA_FORMS_STORAGE_DISK=public ``` -------------------------------- ### Configure Nested Field Mapping Source: https://docs.filaforms.app/integrations/field-mapping Use dot notation within the fieldMappings array to map nested input fields to nested output fields. ```php $mapping = FieldMappingData::from([ 'fieldMappings' => [ 'address.city' => 'location.city_name', 'address.zip' => 'location.postal_code', ], ]); ``` -------------------------------- ### Manage OAuth Tokens Source: https://docs.filaforms.app/integrations/oauth Use the OAuthTokenManager service to retrieve, store, or delete connection tokens. ```php // Get a valid token (auto-refreshes if expired) $token = $tokenManager->getValidToken($connection); // Store new tokens after OAuth exchange $tokenManager->store($connection, $tokenResponse); // Delete tokens (disconnect) $tokenManager->delete($connection); ``` -------------------------------- ### Define Custom Field Settings Source: https://docs.filaforms.app/advanced/custom-field-types Use the withSettings method to provide a configuration form for the field type, backed by a Spatie Laravel Data class. ```php FieldSchema::numeric() ->key('star-rating') ->withSettings( StarRatingSettings::class, fn () => [ TextInput::make('max_stars') ->numeric() ->default(5), ] ); ``` ```php use Spatie\LaravelData\Data; class StarRatingSettings extends Data { public function __construct( public int $max_stars = 5, ) {} } ``` -------------------------------- ### Retrieve Daily Trends Source: https://docs.filaforms.app/core-features/analytics Fetches a 30-day rolling window of daily event counts grouped by date and event type using the FormEvent model. ```php use FilaForms\Core\Models\FormEvent; $trends = FormEvent::getDailyAnalytics($formId, days: 30); ``` -------------------------------- ### Verify Webhook Signature in PHP Source: https://docs.filaforms.app/integrations/webhooks Use the Standard Webhooks library to verify the authenticity of incoming requests using headers. ```php $payload = file_get_contents('php://input'); $headers = getallheaders(); $webhookId = $headers['webhook-id']; $timestamp = $headers['webhook-timestamp']; $signature = $headers['webhook-signature']; // Verify using Standard Webhooks library $wh = new \StandardWebhooks\Webhook($secret); $wh->verify($payload, [ 'webhook-id' => $webhookId, 'webhook-timestamp' => $timestamp, 'webhook-signature' => $signature, ]); ``` -------------------------------- ### Create a Custom Field Type Source: https://docs.filaforms.app/advanced/custom-field-types Extend BaseFieldType and implement the configure method to define the field's schema and behavior. ```php use FilaForms\Core\FieldTypes\BaseFieldType; use FilaForms\Core\FieldTypes\FieldSchema; class StarRatingFieldType extends BaseFieldType { public function configure(): FieldSchema { return FieldSchema::numeric() ->key('star-rating') ->label('Star Rating') ->icon('heroicon-o-star') ->formComponent(StarRatingComponent::class) ->availableValidationRules([ ValidationRule::REQUIRED, ValidationRule::MIN, ValidationRule::MAX, ]) ->searchable() ->sortable(); } } ``` -------------------------------- ### Retrieve File URLs Source: https://docs.filaforms.app/core-features/file-uploads Methods for generating URLs to access stored files. ```php use Illuminate\\\Support\\\Facades\\\Storage; $url = Storage::disk(config('filaforms.storage.disk'))->url($path); ``` ```php $url = app(\\FilaForms\\Core\\Support\\StorageConfig::class)->url($path); ``` -------------------------------- ### Implement Form Manager View Source: https://docs.filaforms.app/advanced/standalone-components Include the form builder component and a custom save button within a Livewire view. ```blade
``` -------------------------------- ### Render Standalone Form from JSON Source: https://docs.filaforms.app/core-features/public-forms Display a form using a JSON schema instead of a database record. ```blade ``` -------------------------------- ### Render Form from Database Record Source: https://docs.filaforms.app/advanced/standalone-components Retrieve a form model by its slug and pass it to the renderer component. ```blade @php $form = \FilaForms\Core\Models\Form::where('slug', 'contact-us')->first(); @endphp @if($form) @endif ``` -------------------------------- ### Register Post-Submit Actions Source: https://docs.filaforms.app/advanced/events-and-hooks Register custom handlers that execute after a submission is stored. ```php use FilaForms\Core\Contracts\PostSubmitActionHandler; FilaFormsPlugin::make() ->registerPostSubmitAction(new CustomPaymentAction()) ->defaultPostSubmitAction('custom_payment'); ``` -------------------------------- ### Define Field Mapping Configuration Source: https://docs.filaforms.app/integrations/field-mapping Use the FieldMappingData DTO to define field mappings, transformations, and static values for integration payloads. ```php use FilaForms\Integrations\Data\FieldMappingData; $mapping = FieldMappingData::from([ 'fieldMappings' => [ 'name_field' => 'contact_name', 'email_field' => 'email_address', ], 'transformations' => [ 'email_field' => 'lowercase', 'name_field' => 'trim', ], 'staticValues' => [ 'source' => 'web_form', 'campaign' => 'summer_2025', ], 'includeUnmappedFields' => false, ]); ``` -------------------------------- ### Display Form Component Logic Source: https://docs.filaforms.app/advanced/standalone-components Retrieves form schema from the database and processes form submissions. ```php use Livewire\Attributes\On; use Livewire\Component; class FormDisplay extends Component { public int $formId; public string $formSchema; public function mount(int $formId): void { $this->formSchema = DB::table('my_forms') ->where('id', $formId) ->value('json_structure'); } #[On('form-submitted')] public function onSubmitted(array $data): void { DB::table('my_submissions')->insert([ 'form_id' => $this->formId, 'data' => json_encode($data), 'created_at' => now(), ]); session()->flash('success', 'Thank you!'); } public function render() { return view('livewire.form-display'); } } ``` -------------------------------- ### Capture Form Builder Data Source: https://docs.filaforms.app/advanced/standalone-components Listen for the form-updated event in a Livewire component to capture and persist form state. ```php use Livewire\Attributes\On; use Livewire\Component; class MyFormManager extends Component { public ?array $formData = null; #[On('form-updated')] public function onFormUpdated(array $formData): void { $this->formData = $formData; } public function save(): void { DB::table('my_forms')->insert([ 'form_json' => json_encode($this->formData), 'created_at' => now(), ]); } public function render() { return view('my-form-manager'); } } ``` -------------------------------- ### Configure Notifications Source: https://docs.filaforms.app/getting-started/configuration Specify admin email recipients and sender details for form notifications. ```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')), ], ``` -------------------------------- ### Configure Honeypot Security Source: https://docs.filaforms.app/getting-started/configuration Enable or disable honeypot spam protection and define the hidden field name. ```php 'security' => [ 'honeypot' => [ 'enabled' => true, 'field_name' => 'website', ], ], ``` -------------------------------- ### Display Form View Template Source: https://docs.filaforms.app/advanced/standalone-components Renders the form renderer component with the provided schema. ```blade
``` -------------------------------- ### POST /api/filaforms/automations/subscribe Source: https://docs.filaforms.app/integrations/zapier Subscribe to form events to receive webhooks. ```APIDOC ## POST /api/filaforms/automations/subscribe ### Description Subscribe to form events to receive webhooks for new submissions. ### Method POST ### Endpoint /api/filaforms/automations/subscribe ``` -------------------------------- ### Configure Field Types in config/filaforms.php Source: https://docs.filaforms.app/getting-started/configuration Use the enabled or disabled arrays to whitelist or blacklist specific field types globally. ```php 'field_types' => [ 'enabled' => [ // Empty array = all field types enabled (default) // 'text', 'textarea', 'select', 'checkbox', 'number', ], 'disabled' => [ // 'rich-editor', 'markdown-editor', ], ], ``` -------------------------------- ### Form JSON Structure Source: https://docs.filaforms.app/advanced/standalone-components The root JSON object representing the form configuration, including settings and the schema hierarchy. ```json { "id": "01HZXF1A2B3C4D5E6F7G8H9J0K", "name": "Customer Feedback Form", "settings": { "experience": { "display_mode": "simple", "submit_button_text": "Send Feedback", "success_message": "Thank you!" } }, "schema": { "sections": [ { "id": "01HZXF2B3C4D5E6F7G8H9J0KL", "code": "personal_info", "name": "Personal Information", "type": "section", "active": true, "sortOrder": 0, "settings": {}, "fields": [ { "id": "01HZXF3C4D5E6F7G8H9J0KLM", "code": "full_name", "type": "text", "label": "Full Name", "active": true, "sortOrder": 0, "width": "100", "validationRules": [], "settings": {}, "options": [] }, { "id": "01HZXF4D5E6F7G8H9J0KLMN", "code": "email", "type": "email", "label": "Email Address", "active": true, "sortOrder": 1, "width": "100", "validationRules": [], "settings": {}, "options": [] } ] } ] } } ``` -------------------------------- ### Register Event Listeners Source: https://docs.filaforms.app/advanced/events-and-hooks Register listeners in the EventServiceProvider or inline within a service provider. ```php use FilaForms\Core\Events\FormSubmitted; use App\Listeners\SyncToCrm; protected $listen = [ FormSubmitted::class => [ SyncToCrm::class, ], ]; ``` ```php use FilaForms\Core\Events\FormSubmitted; use Illuminate\Support\Facades\Event; Event::listen(FormSubmitted::class, function (FormSubmitted $event) { logger()->info('Form submitted', [ 'form' => $event->form->name, 'submission_id' => $event->submission->id, ]); }); ``` -------------------------------- ### Process Data with FieldMapper Service Source: https://docs.filaforms.app/integrations/field-mapping Use the FieldMapper service to transform and map submission data based on a provided FieldMappingData configuration. ```php use FilaForms\Integrations\Services\FieldMapper; $mapper = app(FieldMapper::class); $submissionData = [ 'name_field' => ' Jane Doe ', 'email_field' => 'JANE@EXAMPLE.COM', 'phone_field' => '555-1234', ]; $result = $mapper->map($submissionData, $mapping); // Result: // [ // 'contact_name' => 'Jane Doe', // 'email_address' => 'jane@example.com', // 'source' => 'web_form', // 'campaign' => 'summer_2025', // ] ``` -------------------------------- ### Prefill Form Fields Source: https://docs.filaforms.app/advanced/standalone-components Pass an initialData array to populate form fields with default values. ```blade ``` ```blade ``` -------------------------------- ### Embed Form via Livewire Source: https://docs.filaforms.app/core-features/public-forms Render a form record directly in a Blade view using the form-renderer component. ```blade ``` -------------------------------- ### Implement HasApiTokens in User Model Source: https://docs.filaforms.app/integrations/zapier Ensure the User model uses the Passport HasApiTokens trait instead of Sanctum. ```php use Laravel\Passport\HasApiTokens; class User extends Authenticatable { use HasApiTokens; } ``` -------------------------------- ### Add Private Repository to composer.json Source: https://docs.filaforms.app/getting-started/installation Add the FilaForms composer repository to your project's composer.json file to enable package discovery. ```json { "repositories": [ { "type": "composer", "url": "https://composer.filaforms.app" } ] } ``` -------------------------------- ### Override Default Models Source: https://docs.filaforms.app/advanced/events-and-hooks Configure custom models for forms, submissions, and events in a service provider. ```php use FilaForms\Core\FilaForms; use App\Models\CustomForm; use App\Models\CustomSubmission; use App\Models\CustomEvent; FilaForms::useFormModel(CustomForm::class); FilaForms::useSubmissionModel(CustomSubmission::class); FilaForms::useEventModel(CustomEvent::class); ``` ```php use FilaForms\Core\Models\Form; class CustomForm extends Form { // Add custom relationships, scopes, etc. } ``` -------------------------------- ### POST /filaforms/webhooks/stripe Source: https://docs.filaforms.app/integrations/stripe Endpoint to receive and process webhooks from Stripe. ```APIDOC ## POST /filaforms/webhooks/stripe ### Description Receives events from Stripe to update payment statuses. Supported events include checkout.session.completed, checkout.session.expired, payment_intent.succeeded, and payment_intent.payment_failed. ### Method POST ### Endpoint /filaforms/webhooks/stripe ``` -------------------------------- ### Handle FormSubmitted Event Source: https://docs.filaforms.app/advanced/events-and-hooks Implement a listener class to process data after a form submission is stored. ```php use FilaForms\Core\Events\FormSubmitted; class SyncToCrm { public function handle(FormSubmitted $event): void { $form = $event->form; $submission = $event->submission; $data = $submission->data['custom_fields']; // Sync to your CRM, send to Slack, etc. } } ``` -------------------------------- ### Restrict Field Types per Panel Source: https://docs.filaforms.app/getting-started/configuration Limit available field types for a specific Filament panel using the plugin registration method. ```php FilaFormsPlugin::make() ->onlyFieldTypes(['text', 'textarea', 'select', 'number', 'email']), ```