amitshrestha221's avatar

Livewire Many Input Fields

I am using Laravel 8 with Livewire. I have a scenario where I have 50+ fields in a form. Do I need to define each wire:model as a public property in the component class or is there any easier method for handling request items?

0 likes
2 replies
neilstee's avatar

@amitshrestha221 what I do instead is create an array property like this:

public $myform = [];

And in my form:

<input type="text" wire:model="myform.title">
<input type="text" wire:model="myform.body">
<input type="text" wire:model="myform.etc">
4 likes

Please or to participate in this conversation.