how can i access on array in api in laravel

Viewed 21

how can i return only product and count from "order" ??

data returned in postman

[
    {
        "id": 1,
        "order": [
            {
                "product": "burger",
                "count": 2,
                "price": 50
            },
            {
                "product": "pizza",
                "count": 1,
                "price": 80
            }
        ],
        "table_number": 3
    },
    {
        "id": 2,
        "order": [
            {
                "product": "burger",
                "count": 2,
                "price": 50
            },
            {
                "product": "pizza",
                "count": 1,
                "price": 80
            }
        ],
        "table_number": 4
    }
]
0 Answers
Related