With Livewire, you call the PHP function easily with something like this
But that will call the delete code right away, so rather than doing that, we want to have something that prompts the user to say “Are you sure?” or something along those lines.
And here is how -
<button onclick="confirm('Are you sure?') || event.stopImmediatePropagation()" wire:click="delete_object">DELETE!</button>