Forms\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}";
})
,
Forms\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}";
})
,