### 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