Issue when working with searchable method in Select component
Please make sure you see the video.
The issue is when i work with searchable method in Select component it shows a random number sometimes 8 and sometimes 21 , but when i remove searchable method it just works fine
Here is the filament code:
Here is the code for the
childCategories
scope:
2 Replies
I'm sure there are query-related things to explore within Filament code, which may give clues, but I'd probably first find myself using
dd()
inside the options()
closure to determine what's coming back in those cases. And then I'd probably trace back a layer deeper and dump out the db query that's pulling the data, to know why it's doing what you're seeing.
The Laravel DebugBar is often what I first look at to inspect such queries.
But I sometimes also just do something to the parameters I'm passing to the query that will break it, so that Ignition's error page will be shown, since it will show the whole broken query, but then I can use that query to see more of what's going on behind the scenes ... maybe even run it myself directly on the db.
Since the searchable()
does a lot of generation of subselects from relations, I find sometimes it's harder to follow the bouncing ball by code-diving until I've figured out what might be awry with the generated query. Once I know that part it's easier to dig through core code for answers.The issue is when i work with searchable method in Select component it shows a random text i.e arrow down in my option when tabbing to the searchable select component, but when i remove searchable method it just works fine. How can i solve this issue?