Are you casting to array on the model?
protected $casts = [
'tags' => 'array',
]
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello everyone,
I'm working on one of my projects and I have a small issue.
I created custom field for tags. Tags are stored in array (Vue component) but when I'm saving my array to database, Nova change format and once I retrieve data from DB, I get array with one element who is my array in string format like: '[tag, tag2, tag3]'
In vue I have: ['tag 1', 'tag3', 'tag3', ]
After that, I serialize in model and in my database I get this: a:1:{i:0;s:14:"tag1,tag2,tag3";}
I tried also to use Json.Parse and Stringify but is not working
Someone know what I'm doing wrong and can help me?
Please or to participate in this conversation.