I have this array in the controller after the submitted form holds in variable $product.
[
{
"id": 2,
"name": "nancy",
"cost": 34,
"quantity": 0,
"barcode": 12345,
"category_id": 2,
"created_at": "2020-07-05T16:04:10.000000Z",
"updated_at": "2020-07-09T04:06:09.000000Z"
},
{
"id": 5,
"name": "jk",
"cost": 100,
"quantity": 2,
"barcode": 147258,
"category_id": 2,
"created_at": "2020-07-08T20:34:56.000000Z",
"updated_at": "2020-10-18T13:09:16.000000Z"
}
]
How can I access the properties in objects like id, name, barcode ?
[0 => '{"id":2,"name":"nancy","cost":34,"quantity":0,"barcode":12345,"category_id":2,"created_at":"2020-07-05T16:04:10.000000Z","updated_at":"2020-07-09T04:06:09.000000Z"}', 1 => '{"id":5,"name":"jk","cost":100,"quantity":2,"barcode":147258,"category_id":2,"created_at":"2020-07-08T20:34:56.000000Z","updated_at":"2020-10-18T13:09:16.000000Z"}'];?