livewire alpine js $wire.on code example
Example 1: passing livewire variable in alpine js
You can share data between livewire and apline js using : @entangle
class Counter extends Component
{
public $showDropdown = false;
}
<div x-data="{ open: @entangle('showDropdown') }">
Example 2: using laravel variable inside alpine js
<div x-data="{ showPanel: {{ $showPanel }} }"></div>