pass php variable to alpine js code example
Example: 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;
}
<div x-data="{ open: @entangle('showDropdown') }">
--------------- OR -----------------
<div x-data="{ open: @entangle('showDropdown').defer }">
With this you dont need to use wire model with that data Like
wire:model.defer="showDropdown"