alfasix / alfakit-forms
A Typeform-class form builder for AlfaKit: admins build multi-step forms with conditional logic in the panel, the public fills them on your own pages, and every answer is re-validated on the server.
Requires
- php: ^8.4
- alfasix/alfakit: ^0.2|@dev
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
by Alfa Six
This is a read-only split of the AlfaKit monorepo. Please open issues and pull requests there.
A form builder for AlfaKit panels, in the spirit of Typeform and Tally. Admins build forms in the panel: questions, choices, uploads, ratings, sections, page breaks for multi-step forms and conditional logic. The public fills them outside the panel, on /forms/{slug} or on any Inertia page of your app, in React, Vue or Svelte. Every submission is validated again on the server against the stored definition.
Installation
composer require alfasix/alfakit-forms php artisan vendor:publish --tag=alfakit-forms-migrations php artisan migrate php artisan alfakit-forms:page
Register
use AlfaSix\AlfakitForms\FormsPlugin; $panel->plugin( FormsPlugin::make() ->navigationGroup('Content') ->authorize(fn (User $user): bool => $user->is_admin), );
Embed a form anywhere
use AlfaSix\AlfakitForms\AlfakitForms; Route::get('/', fn () => Inertia::render('home', [ 'newsletter' => AlfakitForms::embed('newsletter'), ]));
<AlfakitComponent component={newsletter} className="max-w-lg" />
Features
- 17 blocks: short and long text, email, phone, website, number, dropdown, single and multiple choice, checkbox, yes / no, date, file upload, rating, section heading, paragraph, page break.
- Per-field label, help, placeholder, width, required and validation (lengths, ranges, choices, dates, file types and sizes, formats picked from a whitelist; admins never type rule strings or regular expressions).
- Conditional logic (all / any rules, eight operators) evaluated in PHP; hidden fields are neither validated nor stored.
- Multi-step wizard with server-side validation of every step.
- Confirmation message or
http(s)redirect, publishing dates, submission limits. - Honeypot, time check, per-IP rate limiting and an optional captcha hook.
- Queued email notifications, a
FormSubmittedevent, CSV / XLSX exports, spam review, stats (views, submissions, conversion). - Tenant-aware, policy or closure authorisation, 13 languages, right-to-left and mobile friendly.
Read the documentation.
License
MIT. See LICENSE.md.