Storing some arbitrary array with a user

Hi, as the title says, I would like to be able to programmatically store some arbitray arrays in the file for a user. If my understanding is correct, then the structure field type isn’t meant for that, right? In my case the data won’t be edited in the panel and will be accessed only by a plugin I’m working on.

Do I need to create a new field type for that or did I miss something?

No, you don’t need a new field type, you can just yaml::encode() your array and retrieve it via the yaml() or toStructure() field methods.

1 Like