Searchable select using model's attribute as label
Hi all,
I have a model
Do you have any suggestions? Thank you.
Pet
, that belongs to User
:
However, I have a problem creating a new Pet for a specific User:
The problem is, that no matter what I do in getSearchResultsUsing
and getOptionLabelUsing
, I won't get User's fullName
to be shown. I tried:
- Using pluck('last_name', 'id')
instead of get
. This shows the last_name
, but getOptionLabelUsing
is not called.
- Using relationship('owner', 'last_name')
. This does not allow using fullName
instead of lastName
.Do you have any suggestions? Thank you.
0 Replies