PHP code example of madbox-99 / filament-form-builder

1. Go to this page and download the library: Download madbox-99/filament-form-builder library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

madbox-99 / filament-form-builder example snippets


'tenant_model' => \App\Models\Team::class,
'tenant_foreign_key' => 'team_id',

use Madbox99\FilamentFormBuilder\FilamentFormBuilderPlugin;

public function panel(Panel $panel): Panel
{
    return $panel->plugins([
        FilamentFormBuilderPlugin::make(),
    ]);
}

use Madbox99\FilamentFormBuilder\Events\FormSubmissionProcessed;

Event::listen(FormSubmissionProcessed::class, function (FormSubmissionProcessed $event) {
    if ($event->actions->createLeadIfHasEmail && !empty($event->formData['email'])) {
        Lead::create([
            'team_id' => $event->form->team_id,
            'email' => $event->formData['email'],
            // ...
        ]);
    }

    if ($event->actions->notifyEmails !== []) {
        Notification::route('mail', $event->actions->notifyEmails)
            ->notify(new FormSubmissionReceived($event->submission));
    }
});