Translatable plugin : make relationship field works
Hi ! I have a Mission model with a
institution() : BelongsTo relationship. On my Mission edit page (resource), I want to show the institution.access_code field but Filament doesn't translate it and try to display the entire object. How can I make it works (display the field in the current locale) ?
Solution
->formatStateUsing(fn (string $state): string => $state['fr']['access_code'])
or
Forms\Components\TextInput::make('access_code.fr')
or
Forms\Components\TextInput::make('access_code.fr')