
Use translatable for relations in select components
- Published: 25 Mar 2024 Updated: 04 May 2024
get translatable attribute in a relationships

when using a relations in a select menu or a filter, and that model is translatable, this is how to get the translatable attribute:
1->getOptionLabelFromRecordUsing(fn (Model $record) => $record->title)

Related Tricks:
Translating components can often be a repetitive task, Fortunately, there's a neat trick to automate this process, making your components instantly translatable.
get translatable attribute in a relationships
Unrequire fields recursively when saving as draft
Custom copy action, click the icon to copy the content
Usability: Knowing whether or not the record was saved.