Using Spatie Translatable

I'm using the following official pluging https://filamentphp.com/plugins/filament-spatie-translatable and everything works fine except. (See the image attachment) And my code for this looks like:
Forms\Components\Select::make('city_id')
->relationship('city', 'name')
->label('City')
->required(),
Forms\Components\Select::make('city_id')
->relationship('city', 'name')
->label('City')
->required(),
Filament
Spatie Translatable by Filament - Filament
Filament support for Spatie's Laravel Translatable package.
No description
4 Replies
LeandroFerreira
LeandroFerreira13mo ago
->relationship('city', fn (Component $livewire): string => 'name->'.$livewire->activeLocale)
->relationship('city', fn (Component $livewire): string => 'name->'.$livewire->activeLocale)
Martin Bojmaliev
Martin BojmalievOP13mo ago
Oh ok, but shouldn’t work this out of the box?
LeandroFerreira
LeandroFerreira13mo ago
no
Martin Bojmaliev
Martin BojmalievOP13mo ago
Thank you And what if the the field has missing locale for the activeLocale ? It throws and error :/

Did you find this page helpful?