Simpler way to have default value in infolist ?

If a value is null or empty in an infolist TextEntry, is there a neat way to specifiy a default holder? This works, but not pretty:
TextEntry::make('personaProfileDetail.ppd_emergency_contact_relation')
->label('Relation')
->getStateUsing(fn ($record) => ! empty($record->personaProfileDetail->ppd_emergency_contact_relation) ? $record->personaProfileDetail->ppd_emergency_contact_relation : 'Nothing Recorded')
TextEntry::make('personaProfileDetail.ppd_emergency_contact_relation')
->label('Relation')
->getStateUsing(fn ($record) => ! empty($record->personaProfileDetail->ppd_emergency_contact_relation) ? $record->personaProfileDetail->ppd_emergency_contact_relation : 'Nothing Recorded')
2 Replies
Matthew
MatthewOP3mo ago
FFS, why didn't I see that!. Thanks.,
Want results from more Discord servers?
Add your server