F
Filament16mo ago
Pocho

format options on relationship manager select in attach form

Is there a way to set the format on options for the select when attaching on a relationship manager? I basically would like to concatenate first_name and last_name in the options, but cant figure out how. I can do it on regular selects using getOptionLabelFromRecordUsing but it does not seem to work on the Attach action select. Here is what I'm doing:
AttachAction::make()
->form(fn (AttachAction $action): array => [
$action
->getRecordSelect()
->getOptionLabelFromRecordUsing(fn(Model $record) => "{$record->first_name} {$record->last_name}"
AttachAction::make()
->form(fn (AttachAction $action): array => [
$action
->getRecordSelect()
->getOptionLabelFromRecordUsing(fn(Model $record) => "{$record->first_name} {$record->last_name}"
4 Replies
Want results from more Discord servers?
Add your server