This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

Asinox
Asinox

Hi guys, im having the next error while i'm uploading an array of images.

Unexpected type of array, should attribute "data" be jsonable?

But first i would like to say, this code was working fine in the "Page Code", i just moved it to a function into the Model, everything is working fine, every data is saved, but not the files.

Here a bit of code:


if($classified->save()){
                    if(\Input::hasFile('photos')){
                        $cv = new \System\Models\File;
                        $cv->data = \Input::file('photos');
                        $classified->images()->add($cv);
                    }
}

Any idea?

Thank you

wmeloff11651
wmeloff11651

/ var array List of attribute names which are json encoded and decoded from the database /

protected $jsonable = ['data'];

Last updated

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.