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

paulgrafx
paulgrafx

Hi,

I am trying to add a repeater to the backend user using the 'public function boot()'. It works fine regarding appearing and adding values, but when saving I keep getting the following error - 'Unexpected type of array, should attribute "repeatername" be jsonable?'

As I understand it because it's being used in the 'public function boot()' then its not calling any models to change and add protected $jsonable = ['repeatername'];

I just checking this is or is not possible since I have had a day with no luck, or if anybody has solved this issue :(

Something along the lines of onSave(){ $value = json_encode($model->repeatername); }

Last updated

dyldin.aleksei26851
dyldin.aleksei26851

You need to add the following code to the boot function

Model::extend(function ($model){ $model->addJsonable([ 'repeatername' ]); })

1-2 of 2

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