What seems to be the problem:
What is the proper way to send blade variables to a Livewire controllers via an event?
Steps to Reproduce:
Here’s what I have:
@foreach ($adGroups as $group)
<a href="#" wire:click="$emit('updateShowGroup', $group)" class="block px-6 py-4 font-semibold bg-white border-b ">
<div>{{ $group }}</div>
</a>
@endforeach
I get $group is undefined
in the console. I’m not seeing anything in the docs about passing along blade variables, just plain strings. Using {{ $group }}
seems to give me odd results.
Thanks for any help! I’m just getting started with Livewire and loving it vs. a large JS framework.
Are you using the latest version of Livewire:
Yes
Do you have any screenshots or code examples: