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) ?

Forms\Components\Group::make()
  ->relationship('institution')
  ->schema([
      Forms\Components\Section::make('Institution')
          ->schema([
              Forms\Components\TextInput::make('access_code')
])
image.png
Solution
->formatStateUsing(fn (string $state): string => $state['fr']['access_code'])

or

Forms\Components\TextInput::make('access_code.fr')
Was this page helpful?