Translatable repeater in relation manager
Hello! I need to make translatable repeater fields in relation manager. Is it possible? Because filament saves translations of repeater fields from resource edit page, but doesnt save from relation manager.
2 Replies
Fields schema:
Equipment.php
Forms\Components\Tabs\Tab::make(__('Exterior'))
->schema([
Forms\Components\Repeater::make('exterior_options')
->label(__('Exterior options'))
->defaultItems(0)
->schema([
Forms\Components\TextInput::make('option')
->required()
->label(__('Option'))
]),
]),
Forms\Components\Tabs\Tab::make(__('Interior'))
->schema([
Forms\Components\Repeater::make('interior_options')
->label(__('Interior options'))
->defaultItems(0)
->schema([
Forms\Components\TextInput::make('option')
->required()
->label(__('Option'))
]),
]),
Forms\Components\Tabs\Tab::make(__('Comfort'))
->schema([
Forms\Components\Repeater::make('comfort_options')
->label(__('Comfort options'))
->defaultItems(0)
->schema([
Forms\Components\TextInput::make('option')
->required()
->label(__('Option'))
]),
]),
Forms\Components\Tabs\Tab::make(__('Security'))
->schema([
Forms\Components\Repeater::make('security_options')
->label(__('Security options'))
->defaultItems(0)
->schema([
Forms\Components\TextInput::make('option')
->required()
->label(__('Option'))
]),
]),
Forms\Components\Tabs\Tab::make(__('Exterior'))
->schema([
Forms\Components\Repeater::make('exterior_options')
->label(__('Exterior options'))
->defaultItems(0)
->schema([
Forms\Components\TextInput::make('option')
->required()
->label(__('Option'))
]),
]),
Forms\Components\Tabs\Tab::make(__('Interior'))
->schema([
Forms\Components\Repeater::make('interior_options')
->label(__('Interior options'))
->defaultItems(0)
->schema([
Forms\Components\TextInput::make('option')
->required()
->label(__('Option'))
]),
]),
Forms\Components\Tabs\Tab::make(__('Comfort'))
->schema([
Forms\Components\Repeater::make('comfort_options')
->label(__('Comfort options'))
->defaultItems(0)
->schema([
Forms\Components\TextInput::make('option')
->required()
->label(__('Option'))
]),
]),
Forms\Components\Tabs\Tab::make(__('Security'))
->schema([
Forms\Components\Repeater::make('security_options')
->label(__('Security options'))
->defaultItems(0)
->schema([
Forms\Components\TextInput::make('option')
->required()
->label(__('Option'))
]),
]),
public $translatable = [
'exterior_options',
'interior_options',
'comfort_options',
'security_options',
];
protected $casts = [
'exterior_options' => 'array',
'interior_options' => 'array',
'comfort_options' => 'array',
'security_options' => 'array',
];
public $translatable = [
'exterior_options',
'interior_options',
'comfort_options',
'security_options',
];
protected $casts = [
'exterior_options' => 'array',
'interior_options' => 'array',
'comfort_options' => 'array',
'security_options' => 'array',
];
hi, did you manage to solve it ?