samedi 28 janvier 2017

How to access child array using foreach loop in laravel

Shpping : [
  {
    "id": "1",
    "name": "Dress",
    "deleted_at": null,
    "created_at": null,
    "updated_at": null,
    "minicomp": [
      {
        "id": "1",
        "cname": "basic",
        "base_id": 44
      },
      {
        "id": "2",
        "cname": "Shirt",
        "base_id": 177444
      },
      {
        "id": "3",
        "cname": "Pants",
        "base_id": 444
     }
   ]
  }
];

I am getting such type of response in postman,

What I want is How to access base_id of minicomp using foreach loop in laravel.

Help me for this. Thanks in Anticipation.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire