outl1ne / nova-simple-repeatable

A Laravel Nova simple repeatable rows field.
MIT License
72 stars 42 forks source link

[Help wanted] [Possible-bug] How to work with nova-translatable #56

Closed briavers closed 1 week ago

briavers commented 9 months ago

I'm trying to make my repeater field translatable, but once i save it stays empty and gives a console error

Packages used optimistdigital/nova-translatable: 1.12 outl1ne/nova-simple-repeatable: 1.4.3 laravel/nova: 3.32

Code

Migration

Schema::table('projects', function (Blueprint $table) {
    $table->json("items")->nullable();
});

model

 public $translatable = [
        'items',
    ];

nova-resource

 SimpleRepeatable::make(__('Bullet points'), 'items', [
                Text::make(__('Bullet point'), 'bullet_point'),
            ])->translatable(),

console Exception, and no items or item title to be found

image
p-jrv commented 1 month ago

Common use case would be calling ->translatable() on a field inside the SimpleRepeatable not on the SimpleRepeatable itself:

SimpleRepeatable::make(__('Bullet points'), 'items', [
                Text::make(__('Bullet point'), 'bullet_point')->translatable(),
            ]),