javaabu/form-builder
| Install | |
|---|---|
composer require javaabu/form-builder:v1.0.0-alpha.1 |
|
| Latest Version: | v1.0.0-alpha.1 |
| PHP: | ^8.4 |
| Laravel: | 12 · 13 |
| License: | MIT |
| Last Updated: | Nov 24, 2026 |
| Links: | GitHub · Packagist |
Form Builder
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.
Related Packages
Fluent form schemas for Laravel: define a form once in PHP and render it with Bl...
WordPress classic-style widgets for Laravel: widget classes with javaabu/stencil...
Filters and sorts for Laravel index pages: define each filter once, apply it to...
Fluent bulk actions for Laravel: each authorized through the Gate with can(), op...
Version History
Pre-releases (1)
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v1.0.0-alpha.1 | ^8.4 | ^12.0 || | MIT |