nodus-it/livewire-forms
A Laravel Livewire package for creating dynamic, reusable forms with validation and model binding. It simplifies form state management and Blade rendering, helping you build complex forms faster with less boilerplate in Livewire applications.
composer require nodus-it/livewire-forms. The package is 0.x, so pin an exact version ("nodus-it/livewire-forms": "0.11.2") rather than using ^0.11 — minor bumps in a pre-1.0 package can change method signatures.README.md (usage examples) → the abstract form class in src/ → src/Fields/ (available field types and their modifiers) → resources/views/ (what actually gets rendered). Class and method names have shifted across 0.x releases; the base form class is the source of truth, not blog posts.Post or User) and port it. Define the form as a class, declare fields as text/select/checkbox/etc., bind an Eloquent model, and render it from Blade as a Livewire component.mount() (constructor argument or explicit setter) rather than in render(). Binding once in mount() means the field values hydrate correctly and you avoid re-reading from the database on every request.company required when type = business") in the form-level override. Validate explicitly in your submit action rather than relying on Livewire's automatic updated validation, which fires per-keystroke and is noisy on large forms.wire:click in Blade. That keeps the save() → redirect() (or dispatch('saved')) flow in one place and lets the button be reused in modals.Livewire::test(YourForm::class, ['post' => $post]), then set('field', $value), call('submit'), and assert both the validation errors and the persisted row. Forms are plain Livewire components, so no special test harness is needed.git diff v0.11.1..v0.11.2 before deploying to anything non-trivial. If you were on v0.11.1, a composer update should be low risk, but verify form rendering in a browser — patches to a form builder frequently touch Blade views.mount()/a lifecycle hook, not in a public property assigned from a closure or an unsaved model instance.fields.name). When rendering errors manually or in tests, check the exact key with $this->getErrorBag()->keys() rather than guessing — mismatched keys are the most common cause of "validation isn't showing".wire:model timing. Default deferred binding means the server value lags the input. Anything that depends on the current value mid-typing (dependent selects, conditional fields) needs live binding on that specific field — do it per-field, not globally, or the form gets chatty.unique rule on a bound model will fail against the record itself. Pass the record's key as an ignore value in the rule, and remember the ignore ID must come from the bound model, not from the request payload.wire:model targets collide and the wrong form submits.save() often leaves stale field state (particularly on create, where the model now has an ID the form doesn't know about) — redirecting to an edit route sidesteps the whole class of bugs.mount()) rather than the field type. Publish the package views only when you need to inspect the render tree; unpublish/restore before upgrading.How can I help you explore Laravel packages today?