How could you configure the filament select component so that I get the first and last name?
public static function form(Form $form): Form
{
return $form
->schema([
Select::make('customer_id')
->relationship('customer', 'name')
->searchable(['name', 'surname'])
->preload()
->required()
->createOptionForm([
TextInput::make('name')
->required()
->label('Nombre'),
TextInput::make('surname')
->required(),
TextInput::make('lastname')
->label('Last Name')
]),
]);
}
I tried with an array but it doesn't work
->relationship('customer', ['name', 'lastname'])
You can ues this function
formatStateUsing(), like this example: