Reputation: 107
It is do not work what I can do for send product_id to component?
<input hidden type="text" value="{{ $row->product_id }}" wire:model="productId">
Upvotes: 0
Views: 1676
Reputation: 2352
with a form you can do something like this
<form wire:click.prevent="save({{ $row->product_id }})">
<input class="form-control" wire:model="description">
<button type="submit"></button>
</form>
// in component
public function save($productId)
{
$product = Product::find($productId);
$product->update(['description' => $this->description]);
}
Upvotes: 1