public $foo = [" "," "," "," "," "," "," "," "," "," "];
// the updated* method follows your variable name and is camel-cased, in this sample, 'foo'
public function updatedFoo()
{
// your code you want to execute
}
So in your view you will have to wire that property to a model:
@foreach($foo as $i => $val)
<input type="text" wire:model="foo.{{$i}}">
@endforeach
now whenever you type anything in one of those input fields you will get the value and you can also get the index of the element in the array:
public function updatedFoo($newVal, $key)
{
// this is just for debugging, you ofcourse would want to do something with the value.
dd($newVal, $key);
}
public function updatedFoo($newVal, $key)
{
// set the value first
$this->validate(); // this should handle validation if you have $rules and display the error if any
}