Form Select - Search Across Relationship
I have 3 resources.
- OfficeResource (Model: Office)
- OfficeAddressResource (Model: OfficeAddress)
- CountryResource (Model: Country)
I have a form on the OfficeResource with a select field. This select field searches the OfficeAddress table and allows for the selection of an address. The OfficeAddress model has a
hasone
relationship with the model Country.
Problem: On my OfficeResource form, I want to search by the address, city, and country.common_name in the address select form element. How would I accomplish this?
(I would love to add something like ->searchable(['street_address', 'city', 'country.common_name'])
But I know that's not possible.
Here is the select element on the OfficeResource form:
3 Replies