I have created custom field in Nova and cannot figure it out: How can I handle the value of the field on the edit page? By default Nova provides you the value of the field in Vue, but my field is a list of many to many self referencing relationships.
Nova is damn good. It's already loading all the dependencies so I just looped through the values:
setInitialValue() {
if (this.field.value.length) {
this.field.value.forEach((alias) => {
this.aliases.push(alias.name)
this.values.push(alias.pivot.alias_id) // here is the actual value from pivot table
})
}
},