How can I pass the id from list and update that item in database?
Code
<button class="acceptOrder btn btn-sm btn-success" wire:click="$emit('orderAccepted', {{$order->id}})">Accept order</button>
protected $listeners = ['acceptOrder'];
public function acceptOrder(Order $order)
{
$order->update(['accepted' => true]);
}
Error
question from:https://stackoverflow.com/questions/65840279/livewire-pass-id-for-updateUncaught SyntaxError: Invalid or unexpected token