my search is broken #8
-
I did the implementation of autocomplete but my searches are broken, as shown in the image below, I don't know how to solve it, could you help me? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
@samuelrac hard to say without seeing your code, but it looks like you are using Eloquent models, so you might not have specified which property to display. Have a look at my demo here, you can see it is being passed a list of user models, so I specify Maybe you need to do something like that? Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Hi, thank you very much for your help, this is exactly what I was missing, I am pulling information from a MongoDB database with Eloquent. However, now I need another help, I'm trying to perform an action when the item is selected in autocomplete, but I'm not getting it. My component configuration is: In this case, I need to retrieve the ID of the item that was selected to perform a save action in REDIS, but I am not able to retrieve the ID of the item.
|
Beta Was this translation helpful? Give feedback.
@samuelrac hard to say without seeing your code, but it looks like you are using Eloquent models, so you might not have specified which property to display.
Have a look at my demo here, you can see it is being passed a list of user models, so I specify
'text' => 'name'
to use thename
property on theuser
model.https://github.com/joshhanley/livewire-autocomplete-demo/blob/d11370a995e494d377ffee02efc94d8f2507a51d/resources/views/livewire/main.blade.php#L11-L14
Maybe you need to do something like that?
Hope this helps!