FilamentF
Filament3y ago
Wiin

Relationship search in belongsTo select

Hello, is it possible to make a relationship search for a resource relationship?

I have this for example:

Forms\Components\Select::make('contact_id')
->relationship(name: 'contact', titleAttribute: 'email')
->searchable(['first_name', 'last_name', 'email', 'organisation.name'])
->required(),

This is not working because 'organisation.name' is not a valid column. Is it possible to do it or do I have to do it differently so I can search contacts by their organisation name?

Thank you!
Was this page helpful?