Translatable Select Data

Hi Community, I have a translateable resource and the selects look like this, what do you think I am missing? Many thanks
No description
Solution:
Yes it worked like this, thank you
No description
Jump to solution
7 Replies
Patrick Boivin
What is the context of this form? Custom page, relation manager, ...
afatmustafa
afatmustafaOP2y ago
It's just ProductResource
Patrick Boivin
Not sure, but have you tried getOptionLabelFromRecordUsing?
->getOptionLabelFromRecordUsing(fn ($record) => $record->name),
->getOptionLabelFromRecordUsing(fn ($record) => $record->name),
Can you share the code of the Select field?
afatmustafa
afatmustafaOP2y ago
Of course
Select::make('product_category_id')
->label('Ürün Kategorisi')
->relationship(name: 'productCategory', titleAttribute: 'title')
->searchable()
->preload()`
Select::make('product_category_id')
->label('Ürün Kategorisi')
->relationship(name: 'productCategory', titleAttribute: 'title')
->searchable()
->preload()`
Patrick Boivin
I think this should work
->getOptionLabelFromRecordUsing(fn ($record) => $record->title),
->getOptionLabelFromRecordUsing(fn ($record) => $record->title),
Solution
afatmustafa
afatmustafa2y ago
Yes it worked like this, thank you
No description
pocket.racer
pocket.racer2y ago
hmm this may have worked but i wonder if it's something that need to be fixed in filament v3 since in v2 there isn't a need to do this from what i recall

Did you find this page helpful?