javaabu / form-builder
Dynamic forms for Laravel: versioned form definitions and entries in the database, a builder and filling UI in Blade and Inertia React built on javaabu/stencil, sections, repeating groups, wizards, cascading and conditional inputs, read-only and printable entries, fluent definitions, JSON import and
Requires
- php: ^8.4
- illuminate/console: ^12.0 || ^13.0
- illuminate/contracts: ^12.0 || ^13.0
- illuminate/database: ^12.0 || ^13.0
- illuminate/filesystem: ^12.0 || ^13.0
- illuminate/http: ^12.0 || ^13.0
- illuminate/routing: ^12.0 || ^13.0
- illuminate/support: ^12.0 || ^13.0
- illuminate/validation: ^12.0 || ^13.0
- illuminate/view: ^12.0 || ^13.0
- javaabu/forms: ^2.0@dev
- javaabu/manifest: ^1.0@dev
- javaabu/permissions: ^3.0@dev
- javaabu/stencil: ^1.0@dev
Requires (Dev)
- inertiajs/inertia-laravel: ^2.0
- javaabu/boost-javaabu-guidelines: ^1.4
- javaabu/translatable: ^3.0@dev
- laravel/ai: ^1.3
- laravel/pint: ^1.24
- orchestra/testbench: ^10.0 || ^11.0
- phpunit/phpunit: ^11.5.3 || ^12.5.8
Suggests
- inertiajs/inertia-laravel: Renders the pages with Inertia React when form-builder.views is inertia (^2.0)
- javaabu/translatable: Form names, labels, help and options in every language (^3.0)
- laravel/ai: The assistant that builds or edits a form from a description (^1.3)
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-15 10:55:02 UTC
README
Dynamic forms for Laravel. Form definitions and entries live in the database, versioned so every entry keeps pointing at the version it was filled with. Forms compile to javaabu/stencil schemas, so they render in Blade and Inertia React with validation and conditions built in.
- A builder in Blade or Inertia React (
Route::formBuilder()): sections and fields added, configured and reordered by drag and drop or the keyboard, previews, drafts and publishing. - Sections, wizards, repeating groups, conditional sections and fields, and cascading selects.
- 17 field types, and your own: builder settings, a stencil field, a React component, storage and display.
- Forms defined fluently in seeders, the builder optional. JSON export and import, and an optional laravel/ai assistant that builds forms from a description.
- Entries you can query (
whereAnswer()), shown read-only and printable, exported to CSV. - Permissions through javaabu/permissions for any guard and user model. Optional javaabu/translatable. Dhivehi and RTL.
use Javaabu\FormBuilder\Definitions\Field; use Javaabu\FormBuilder\Definitions\Section; use Javaabu\FormBuilder\Facades\FormBuilder; FormBuilder::define('feedback') ->name(['en' => 'Feedback', 'dv' => 'ފީޑްބެކް']) ->sections([ Section::make('main')->fields([ Field::radio('rating')->label(__('Rating'))->required()->options(['1' => __('Bad'), '5' => __('Good')]), Field::textarea('comment')->label(__('Comment'))->thaana()->visibleWhen('rating', '1'), ]), ]) ->sync(); // routes/web.php Route::formBuilder(['guard' => 'web_admin', 'prefix' => 'admin/forms', 'name' => 'admin.forms']); Route::formBuilderFill(); // /f/feedback // anywhere $entry = FormBuilder::submit('feedback', $request, submitter: $request->user()); FormEntry::whereAnswer('rating', '1')->count();
Documentation
The docs are in docs/, indexed for assistants in llms.txt.
Testing
composer test pnpm test
Changelog
See CHANGELOG.
Contributing
See CONTRIBUTING.
Security
If you discover a security issue, email info@javaabu.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). See License File for more information.