json icon indicating copy to clipboard operation
json copied to clipboard

Save data but now show data

Open abkrim opened this issue 5 years ago • 4 comments

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

abkrim avatar Jun 02 '20 08:06 abkrim

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

zareismail avatar Jun 15 '20 08:06 zareismail

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

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

rvalenzuelaferrada avatar Sep 03 '20 04:09 rvalenzuelaferrada

Same error!

vFire avatar Nov 26 '20 12:11 vFire

Just cast to json. everything work like a charm.

SadeghPM avatar Apr 26 '21 08:04 SadeghPM