Confirm Livewire Action through Alpine JS Dialog

Example Alpine JS Livewire


This is a free component. Login to your account to view / download the component code.

Component Class


namespace App\Http\Livewire;

use Livewire\Component;

class ConfirmEventCapture extends Component
    public $count = 0;
    public function render()
        return view('livewire.confirm-event-capture');

    public function increment()

Component View File

    <div x-data={}>
        <h1 x-text="$wire.count"></h1>
        <button class="btn btn-primary text-white" 
                x-on:click="if (confirm('Confirm Icrement?')) {
            Push Me to Icerement