Pocho
Pocho
FFilament
Created by Pocho on 8/18/2023 in #❓┊help
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}"
7 replies