javaabu / stencil
Fluent form schemas for Laravel: define a form once in PHP and render it with Blade (javaabu/forms) or Inertia React (@javaabu/forms), with model binding, validation and closure-evaluated, conditional props.
Requires
- php: ^8.4
- illuminate/contracts: ^12.0 || ^13.0
- illuminate/database: ^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
Requires (Dev)
- javaabu/boost-javaabu-guidelines: ^1.4
- javaabu/translatable: ^3.0@dev
- laravel/pint: ^1.24
- orchestra/testbench: ^10.0 || ^11.0
- phpunit/phpunit: ^11.5.3 || ^12.5.8
Suggests
- javaabu/translatable: Per-locale inputs for translatable fields (^3.0)
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-16 07:40:48 UTC
README
Fluent form schemas for Laravel. Define a form once in PHP and render it with Blade (javaabu/forms) or Inertia React (@javaabu/forms), with model binding, validation rules derived from the schema, and closure-evaluated, conditional props.
$form = Form::make() ->model($article) ->action(route('articles.update', $article)) ->schema([ Section::make(__('Details'))->columns(2)->schema([ TextInput::make('title')->required()->maxLength(255)->thaana(), Select::make('status')->options(ArticleStatuses::class)->required(), Select::make('tags')->multiple()->relationship('tags', 'name'), TextInput::make('company_name')->visibleWhen('type', 'company'), ]), ]);
{{ $form }}
<StencilForm schema={form} /> // Inertia::render('Articles/Edit', ['form' => $form])
$article = $form->save(); // validates the request, fills the model, saves it and its relationships
Documentation
You'll find the documentation on https://docs.javaabu.com/stencil, and in the docs folder.
AI coding assistants can start from llms.txt. The package ships a Laravel Boost skill and guideline, which Boost finds by itself. See AI assistants.
Testing
composer test pnpm test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email info@javaabu.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.