Appearance
FormBuilder Module
Overview
The FormBuilder module is a key component of the application that allows users to create, manage, and collect responses from custom forms. It provides a structured way to define forms with various question types, manage their lifecycle through different statuses, and analyze the collected responses.
The module is built on top of Filament and integrates seamlessly with the Laravel application, providing an intuitive admin interface for managing forms and viewing responses.
Events
The FormBuilder module dispatches events that you can listen for in your application:
FormResponseCreated
This event is fired whenever a new form response is submitted. You can use this event to perform custom actions with the response data.
php
use Modules\FormBuilder\Events\FormResponseCreated;
use Modules\FormBuilder\Models\FormResponse;
class YourCustomListener
{
public function handle(FormResponseCreated $event): void
{
$formResponse = $event->formResponse;
// Access the form
$form = $formResponse->form;
// Access the answers
foreach ($formResponse->answers as $answer) {
// Process each answer
$question = $answer->question;
$value = $answer->value;
// Your custom logic here
}
}
}