armincms / json

A laravel nova field
MIT License
26 stars 2 forks source link

Bug when saving #4

Closed RaphaelBP closed 4 years ago

RaphaelBP commented 4 years ago

Hello,

Nice plugin but I have a problem when i want to save multi fields :

 Json::make("Attributes2", [ 
                Text::make(__('field1')),
                Text::make(__('field2')),
                Text::make(__('field3')),
            ]),

Form result :

Capture d’écran 2020-03-06 à 22 48 50

When saving in database field:

{"0":"{\"0\":\"{\\\"field1\\\":\\\"value1\\\"}\",\"field2\":\"value2\"}","field3":"value3"}

I'm using Laravel 6 and Nova 2.10.

Thanks for help. Bye.

zareismail commented 4 years ago

Hi; you should cast your "Attribute2" attribute into JSON