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:
Custom copy action, click the icon to copy the content
Form Builder lets you build dynamic, versioned forms in Filament and attach them to any model. Responses are stored in JSON with zero boilerplate.
Bring the sticky actions back form filament v2
Unrequire fields recursively when saving as draft
make all Field or any components translatable