© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•11mo ago•
2 replies
aleronal_

Search bar split by comma?

Hey, I’ve kind of made this work already but looking for a better approach maybe?

I have a table resource and I would like to search for ids split by comma,
So I’m doing something like

->searchable(query: function($query,$search){ return $query->whereIn(id,$search)

This works! But I have to pass the ids in a single string without trailing spaces!

If I pass on the search bar “1, 2, 3”It doesn’t search!
It looks like when adding the space the searchable trait gets called 3 times (I figure this out by dump($search)) and only looks for the last one.
I don’t really want to add a filter since we already have the search bar, is there a better approach or a fix to this?
Thanks in advance!!
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Need a search bar!
FilamentFFilament / ❓┊help
3y ago
Add Spotlight Search Bar to Top Bar
FilamentFFilament / ❓┊help
2y ago
Align heading with search bar
FilamentFFilament / ❓┊help
13mo ago