Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SigalZ's avatar

Delete with Livewire

Hello,

I wonder, when I want to delete a record with Livewire, do I still need to use a form or is it enough to just check permissions in the component like so:

public function cancelOrder(Order $order)
 {
        $this->authorize('cancel', Order::class);
		//.... do the delete
}

Thank you.

0 likes
2 replies
tykus's avatar
tykus
Best Answer
Level 104

What do you mean by need a form; how is the Livewire request being initiated from the view?

If you are already using a button with wire:click directive, then that should be sufficient:

<button type="button" wire:click.prevent="cancelOrder">Cancel Order</button>

https://livewire.laravel.com/docs/wire-click

1 like
SigalZ's avatar

@tykus Thank you. I just know that with Laravel it is recommended to use forms to delete, so I was wondering.

I am doing the wire:click on a button.

Thanks

Please or to participate in this conversation.