0
votes

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">

1
The answer is, it depends. Some context would help. What are you trying to achieve?Qirel

1 Answers

1
votes

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]);
}