Nested object as a users additional fields

My user schema something like this. json
{
"first_name": "...",
"address": {
"address_line_1": "...",
"city": "..."
},
"status": "...",
"leave_privileges": [
{
"type": "...",
"days": "..."
}
],
"department": {
"name": "..."
},
"employee_meta_data": {
"employee_passport": {
"upload_image": "...",
"date_of_issue": "...",
"date_of_expiry": "...",
"image": "...",
"passport_number": "..."
}
}
}
{
"first_name": "...",
"address": {
"address_line_1": "...",
"city": "..."
},
"status": "...",
"leave_privileges": [
{
"type": "...",
"days": "..."
}
],
"department": {
"name": "..."
},
"employee_meta_data": {
"employee_passport": {
"upload_image": "...",
"date_of_issue": "...",
"date_of_expiry": "...",
"image": "...",
"passport_number": "..."
}
}
}
How add this kind of data in additional fields?
4 Replies
shahreaz
shahreazOP3w ago
please @bekacru
bekacru
bekacru3w ago
nested objects aren't supproted as additional fields
shahreaz
shahreazOP3w ago
I can make a plugin that will make a UserMetadata table and link it with user table. Is it a right approch? or are there any other ways to achieve this schema?

Did you find this page helpful?