Help with Global Search in Filament Relation Manager without a Resource
What I am trying to do:
I have a
- If the
The global search does not seem to work for this Relation Manager setup. Has anyone successfully implemented global search for just a Relation Manager (without a Resource), or is there a way to search the submissions? Any advice or examples would be helpful. The table search is working fine, it's just the global search I'm struggling with. Code snippets from my setup: PcoFormSubmissionsRelationManager: Thanks in advance for any insights!
I have a
ProfileResource
that contains a PcoFormSubmissionsRelationManager
, there is no standalone Filament Resource for PcoFormSubmissionsResource
. I want to enable the global search feature in FilamentPHP to search and retrieve the values of these form submissions by way of the submissionValues
field.
What I did:- If the
PcoFormSubmission
had its own Filament Resource, I would typically use protected static ?string $recordTitleAttribute = 'submissionValues';
to make it searchable.
- However, since this is a Relation Manager (and not a separate Resource), I am unsure how to achieve the same result.
My issue/the error:The global search does not seem to work for this Relation Manager setup. Has anyone successfully implemented global search for just a Relation Manager (without a Resource), or is there a way to search the submissions? Any advice or examples would be helpful. The table search is working fine, it's just the global search I'm struggling with. Code snippets from my setup: PcoFormSubmissionsRelationManager: Thanks in advance for any insights!
3 Replies
The DefaultGlobalSearchProvider only includes resources. Could possibly extend that and override to search other things. But relationship managers are setup to work with it directly.
GitHub
filament/packages/panels/src/GlobalSearch/DefaultGlobalSearchProvid...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament
@awcodes Thanks for replying. I hacked something together that works by overriding the ProfileResource global search functions, but that's not what I want to achieve. I guess I could make a Filament resource, then hide it from navigation to get the functionality I'm seeking. But I was in the midst of source diving to try to figure this out. If I create something less hackey, I'll reply with my solution.