I have this array of objects:
[
{
"id": 4,
"user_id": 1,
"business_id": 2,
"branch_id": 3,
"type": "service",
"item": "Typing",
"unitPrice": 100,
"bulkUnit": 20,
"bulkUnitPrice": 80,
"availableUnits": "NA",
"created_at": "2019-05-03 11:36:33",
"updated_at": "2019-05-03 11:36:33"
},
{
"id": 5,
"user_id": 1,
"business_id": 2,
"branch_id": 3,
"type": "service",
"item": "Printing",
"unitPrice": 70,
"bulkUnit": 50,
"bulkUnitPrice": 40,
"availableUnits": "NA",
"created_at": "2019-05-03 11:37:29",
"updated_at": "2019-05-03 11:37:29"
}
]
For each object, I need to use the value of the item property as a property name in a new object, like this:
{
"Typing": null,
"Printing": null
}