Courses

Practical Laravel Livewire 2 from Scratch

Deleting Records with Confirmation Prompt

Previous: "Loading data" indicator with wire:loading
avatar

Just encase you need to copy/paste

onclick=" return confirm('Are you sure?') || event.stopImmediatePropagation ()"

👍 1
😍 1
avatar
You can use Markdown
avatar

Hopefully there's a better way to do the confirmation in Livewire. As said at the beginning of the tutorial, Livewire helps devs write zero JS. But now, we're just written a line of JS. Yes, it's only minor. But still :)

avatar

Well yeah you can. You can make your own confirmation modal even with a native html dialog element and call it. But this is way quicker and simple. Or you can use something like sweetalert

avatar
You can use Markdown
avatar
You can use Markdown