share data between livewire and alpine js code example

Example 1: share data between livewire and alpine js

You can share data between livewire and apline js using : @entangle

class Counter extends Component
{
    public $showDropdown = false;
}

--------------- OR -----------------
With this you dont need to use wire model with that data Like wire:model.defer="showDropdown"

Example 2: passing livewire variable in alpine js

You can share data between livewire and apline js using : @entangle

class Counter extends Component
{
    public $showDropdown = false;
}

Example 3: Sharing State Between Livewire And Alpine

You can sharing variable between livewire and alpine using : @entangle

class Counter extends Component
{
    public $showDropdown = false;
}

Tags:

Misc Example