I'm working in laravel php and have blade.php views,
I have the following component which is used in blade.php as follows
<x-form.select
wire:model.defer="state.trip_destination"
:search="true"
x-search="
(query) => {
return new Promise((resolve, reject) => {
resolve(fun()); //HERE
});
}
"
name="state.trip_destination"
type="text"
id="trip-destination"
/>
Now I want to call the function fun() which is just returning a string, and is defined as
<script>
function fun()
{
return "HELEL";
debugger;
};
</script>
It doesn't goes to that function because it is out of scope, is there any way to solve this problem.
Thanks,