Calling a livewire PHP method from a custom field component
Hey,
I have the need to call a PHP method from the view of a Customer Field Component.
If I use
$wire.methodName()
it states the method doesnt exist on the livewire field component.
What's happening is im getting a Javascript event which results in a code, with that code, i need to make an API call and set the state of the field to the result of that API call.
Any way to do this?3 Replies
For extra context, im getting that event, and trying to call a method on the component
Ok so digging further, i found https://discord.com/channels/883083792112300104/1158734504635142215/1158734504635142215
So I added
and
But results in
Ah, i fell for it π My
{{ $getStatePath() }}
wasnt a string, needed to add quotes '{{ $getStatePath() }}'
Solution
That fixed the issue π