armincms / json

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

Save data but now show data #6

Open abkrim opened 4 years ago

abkrim commented 4 years ago

Laravel: 7.13.0 Nova: 3.6.0

Hi.

I'm testing your package.

Simple test not work.

            Json::make('data', [
               Select::make('Provider name', 'provider_name')
                ->options([
                    'castris' => 'Castris',
                    'ovh' => 'OVH',
                    'scaleway' => 'Scaleyway'
                ])->rules('required')->default('ovh'),
            ])->saveHistory()->hideFromIndex(),

This save data in data column, but not show when try to See or Edit a row.

Also if remove hidefromIndex() not show value.

But in database is correct. data has saved value.

Screenshot_20200602_100218

zareismail commented 4 years ago

Hi. thanks for reporting. Please cast your value as Json and test again

rvalenzuelaferrada commented 4 years ago

I am using this, but it does not work, could you please help me?

    protected $casts = [
        'attributes' => 'array'
    ];
vFire commented 3 years ago

Same error!

SadeghPM commented 3 years ago

Just cast to json. everything work like a charm.