nova-json
nova-json copied to clipboard
outl1ne/nova-multiselect-field is not working with json field
Hello,
outl1ne/nova-multiselect-field is not working with json field field value is not saved. I don't have error on frontend or in laravel.log . Value is just ignored.
...
JSON::make('settings', 'settings', [
Multiselect::make('Allowed countries', 'allowed_countries')
->placeHolder('add a country...')
->saveAsJSON()
->clearOnSelect()
->options(['es' => 'Spain', 'fr' => 'France']),
]),
...
When you directly store value into database as an array, field is filled properly when you edit page string value separated by "," doesn't work.
{"allowed_countries": ["es"]}
When you save resource, it's look that data on post are sent correctly:
settings->allowed_countries[0] = 'es',
settings->allowed_countries[1] = 'fr',
Can you take a look?
Regards