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
Patrick Boivin16mo ago
What is the context of this form? Custom page, relation manager, ...
afatmustafa
afatmustafaOP16mo ago
It's just ProductResource
Patrick Boivin
Patrick Boivin16mo ago
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
afatmustafaOP16mo 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
Patrick Boivin16mo ago
I think this should work
->getOptionLabelFromRecordUsing(fn ($record) => $record->title),
->getOptionLabelFromRecordUsing(fn ($record) => $record->title),
Solution
afatmustafa
afatmustafa16mo ago
Yes it worked like this, thank you
No description
pocket.racer
pocket.racer16mo 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?