A Filament plugin and package that allows the creation of forms via the admin panel for collecting user data on the front end. Forms are composed of filament field components and support all Laravel validation rules. Form responses can be rendered on the front end of exported to .csv.
- PHP 8.2+
- Laravel 11.0+
- Filament 3.0+
Install the plugin via Composer:
composer require tapp/filament-form-builder
public and run migrations with
php artisan vendor:publish --tag="filament-form-builder-migrations"
You can publish the view file with:
php artisan vendor:publish --tag="filament-form-builder-views"
You can publish the config file with:
php artisan vendor:publish --tag="filament-form-builder-config"
Add this plugin to a panel on plugins()
method (e.g. in app/Providers/Filament/AdminPanelProvider.php
).
use Tapp\FilamentFormBuilder\FilamentFormBuilderPlugin;
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugins([
FilamentFormBuilderPlugin::make(),
//...
]);
}
Add this to your tailwind.config.js content section:
content: [
...
"./vendor/tapp/**/*.blade.php",
],
You can disable the redirect when including the Form/Show component inside of another component by passing the 'blockRedirect' prop as follows
@livewire('tapp.filament-form-builder.livewire.filament-form.show', ['form' => $test->form, 'blockRedirect' => true])
The FilamentForm/Show component emits an 'entrySaved' event when a form entry is saved. You can handle this event in a parent component to as follows.
class ParentComponent extends Component
{
protected $listeners = ['entrySaved'];
public function entrySaved(FilamentFormUser $survey)
{
// custom logic you would like to add to form entry saving logic
}
}