jaocero / conversational-forms
Typeform-style conversational forms for Filament. One question at a time, fully in your Laravel app.
Fund package maintenance!
Requires
- php: ^8.2
- filament/filament: ^5.11
- illuminate/contracts: ^12.0|^13.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.24
- nunomaduro/collision: ^8.1|^9.0
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^3.7|^4.0|^5.0
- pestphp/pest-plugin-arch: ^3.0|^4.0|^5.0
- pestphp/pest-plugin-laravel: ^3.0|^4.0|^5.0
- rector/rector: ^2.0
Suggests
- bacon/bacon-qr-code: Show a QR code for builder-made conversations in the share panel (^3.0).
Provides
None
Conflicts
None
Replaces
None
README
Typeform-style conversational forms for Filament. One question at a time, fully in your Laravel app.
Warning
This package is in early development (0.x). The API may change before v1.0.0. See the roadmap.
- 23 question types, one per screen, with a progress bar and welcome and end screens.
- Keyboard first: Enter to continue, letter and number shortcuts, auto-advance after a choice.
- Logic: jumps, conditions, multiple endings and scores, checked again on the server.
- Build in code or in a no-code builder inside your Filament panel.
- No theme setup. Dark mode, mobile and accessibility are built in.
Requirements
- PHP 8.2+
- Laravel 12 or 13
- Filament 5.11+
Installation
composer require jaocero/conversational-forms php artisan filament:assets
That's it. No custom theme or Vite changes needed. Run php artisan filament:assets again after every update of the package.
Quick start
Add a Conversation to any Filament form and handle the answers in your Livewire component:
use Filament\Schemas\Schema; use JaOcero\ConversationalForms\Components\Conversation; use JaOcero\ConversationalForms\Livewire\Concerns\InteractsWithConversation; use JaOcero\ConversationalForms\Livewire\ConversationResult; use JaOcero\ConversationalForms\Questions\Email; use JaOcero\ConversationalForms\Questions\MultipleChoice; use JaOcero\ConversationalForms\Questions\ShortText; use JaOcero\ConversationalForms\Screens\EndScreen; class Onboarding extends Page { use InteractsWithConversation; public ?array $data = []; public function mount(): void { $this->form->fill(); } public function form(Schema $schema): Schema { return $schema ->statePath('data') ->components([ Conversation::make([ ShortText::make('name')->label("What's your name?")->required(), Email::make('email')->label('Nice to meet you, {name}! Your email?')->required(), MultipleChoice::make('plan') ->label('Which plan are you interested in?') ->options(['starter' => 'Starter', 'team' => 'Team', 'enterprise' => 'Enterprise']), ])->endScreen(EndScreen::make()->title('Thanks, {name}!')), ]); } protected function handleConversationSubmission(array $data, ConversationResult $result): void { Lead::create($data); // the plugin never stores anything, you decide } }
On a Filament Page, render it with EmbeddedSchema::make('form') in the page's content() schema.
Question types
There are 23 question types, and any other Filament field works inside a conversation too.
| Group | Questions |
|---|---|
| Text | ShortText, LongText, Email, Website, Phone, Number |
| Choice | MultipleChoice, PictureChoice, Dropdown, YesNo, Checkbox, LegalConsent |
| Scales | OpinionScale, Nps, Rating, Matrix, Ranking |
| Date and time | DateQuestion, TimeQuestion |
| Details | ContactInfo, Address |
| Files and media | FileUpload, Signature, AudioAnswer, VideoAnswer |
Use Statement, QuestionGroup and HiddenField to structure a conversation. See all questions and options.
Logic
Decide where to go after each answer:
use JaOcero\ConversationalForms\Logic\Logic; MultipleChoice::make('plan') ->options([...]) ->logic([ Logic::when('plan', 'is', 'enterprise')->jumpTo('company_size'), Logic::when('plan', 'is', 'none')->end(), ]);
Conditions, scores, endings and show/hide are covered in the logic guide.
Public pages
Serve a full-screen conversation at a public URL, no panel or login needed:
class JobApplication extends ConversationPage { public function conversation(Conversation $conversation): Conversation { return $conversation->components([/* ... */]); } } Route::livewire('/apply', JobApplication::class);
See public pages.
No-code builder
Let your team build conversations in a Filament panel, with a live preview, logic, publishing and response analytics:
$panel->plugin(ConversationalFormsPlugin::make());
php artisan conversational-forms:install
See the builder.
Learn more
- Questions: every question type and conversation option
- Logic: jumps, conditions, scores, endings and saving answers
- Public pages
- The builder: responses, sharing, spam protection and events
- Theming: bundled themes and CSS variables
- Testing
- Keyboard, accessibility and troubleshooting
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
