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

grislysquirrel15554
grislysquirrel15554

Hello,

I'm having some problems after following the tutorial on how to extend the User plugin. I'm basically building the same plugin in the video, as I'm just giving my users the ability to add their pet information in their profile. However, when I try to save the data from the fields, I get this error: http://imgur.com/kE6JUC0 I don't have a "pet" field in my Pet model, so I can't just add "protected $jsonable = ['pet'];". You can check my plugin code here: https://github.com/GoodNello/Pets

Can you help me? The error message is not very helpful.

Thanks!

yoyoma
yoyoma

Why can't you just add protected $jsonable = ['pet'];?

I don't see the problem. I got the same issue with the user plugin and added protected $jsonable = ['column_name']; to the user model and it got rid of my issues.

From what I know, you need the column has to be jsonable in the model if you're working with arrays.

grislysquirrel15554
grislysquirrel15554

Thank you for your answer, but even by adding "protected $jsonable = ['pet'];" in my Pet model, it gives me the same error.

Last updated

dshoreman
dshoreman

For fields that don't really exist in the database, you should use the purgeable trait in addition to any formatting traits such as jsonable.

https://octobercms.com/docs/database/traits#purgeable

1-4 of 4

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