Modify label in select options
id like to change the title attribute, i currently have it like this (song name):
but id like to show the artist too:
but idk how to do it hmmm
LevelsForms\Components\Select::make('song_id')
->relationship(name: 'song', titleAttribute: 'name')Avicii - LevelsForms\Components\Select::make('song_id')
->searchable()
->relationship(name: 'song', titleAttribute: 'name')
->required()
->getOptionLabelFromRecordUsing(function (Song $record) {
$artistName = $record->artists()->first()?->name ?? '';
return "{$artistName} - {$record->name}";
})
,