stepanenko3 / nova-json

The JSON field wrapper allows you to specify multiple fields which will be resolved into a single model attribute. This allows you to validate every information you store inside a json column seperately.
MIT License
39 stars 8 forks source link

Fields not showing #14

Closed ideal1sm closed 1 year ago

ideal1sm commented 1 year ago

Hi,

I have installed package and cast my json field - imported with use statement t the top as so:

JsonArray::make('Mails', 'data->main')
                ->fullWidth()
                ->rules([
                    'required',
                    'array',
                    'between:1,10',
                ])
                ->field(
                    field: Text::make('Email', 'email')
                        ->fullWidth()
                        ->rules([
                            'required',
                        ]),
                ),

However unfortunately this has not worked for me - on Nova detail and edit it shows label name but no text fields.

Data is stored in the database.

ideal1sm commented 1 year ago

Need to write in model. Sorry for issue

protected $casts = [
        'data' => 'array'
    ];