mercredi 19 février 2020

loop through laravel object and read data and assign to a another variable

i want to read laravel object and assign it in to a another variable enter image description here

enter image description here

enter image description here

i want to read those markets[] and products[] and assign to a another variable please some one help

{
   "1006032":{
      "id":1006032,
      "name":"Germany Regionalliga North East 22",
      "start_date":"2020-02-20 18:00:00",
      "icon":null,
      "display_flag":1,
      "base_competition_id":1000028,
      "events":[
         {
            "id":1051919,
            "name":"Hertha Berlin II & ZFC Meuselwitz",
            "display_flag":1,
            "start_date":"2020-02-20 18:00:00",
            "competition_id":1006032,
            "market_count":1,
            "dst_uri":"",
            "teams":[
               {
                  "id":3106,
                  "name":"Hertha Berlin II",
                  "icon":null,
                  "display_flag":0,
                  "position":"home",
                  "requested_at":15821738127576
               },
               {
                  "id":3107,
                  "name":"ZFC Meuselwitz",
                  "icon":null,
                  "display_flag":0,
                  "position":"away",
                  "requested_at":15821738127578
               }
            ],
            "markets":[
               {
                  "id":1051560,
                  "name":"Match Winner",
                  "line":0,
                  "market_status":"O",
                  "display_flag":1,
                  "market_type_id":1000022,
                  "event_id":1051919,
                  "note":"",
                  "boost_available":false,
                  "selections":[
                     {
                        "id":455957,
                        "name":"Home",
                        "line":0,
                        "price":5,
                        "won":false,
                        "display_flag":1,
                        "selection_status_id":1,
                        "requested_at":15821738127597
                     },
                     {
                        "id":455958,
                        "name":"Draw",
                        "line":0,
                        "price":8,
                        "won":false,
                        "display_flag":1,
                        "selection_status_id":1,
                        "requested_at":15821738127601
                     },
                     {
                        "id":455959,
                        "name":"Away",
                        "line":0,
                        "price":4,
                        "won":false,
                        "display_flag":1,
                        "selection_status_id":1,
                        "requested_at":15821738127604
                     }
                  ],
                  "markettypegroup":{
                     "id":1,
                     "name":"More Markets",
                     "description":"Markets Types that have not been grouped",
                     "display_flag":1,
                     "icon":null,
                     "requested_at":15821738127606
                  },
                  "requested_at":15821738127606
               }
            ],
            "products":[
               {
                  "product_id":10,
                  "bet_type":null,
                  "product_code":"TBF",
                  "product_name":"TopBetta Fixed",
                  "fixed":true,
                  "available":true,
                  "product_image":null,
                  "ribbon_image":null,
                  "has_pool":false,
                  "product_description":"Guarantees to pay at least the best of the 3 TAB dividends",
                  "product_note":null,
                  "product_tooltip":null,
                  "background_colour":null,
                  "multi_available":false,
                  "ordinal":0,
                  "margin":0,
                  "product_type":"standard",
                  "price_id":0,
                  "pool_total":0,
                  "first_leg":null,
                  "requested_at":15821738127616
               }
            ],
            "requested_at":15821738127616
         }
      ],
      "base_competition":{
         "id":1000028,
         "name":"Germany Regionalliga North East",
         "icon":null,
         "display_flag":1,
         "sport_id":19,
         "order":0,
         "sport":{
            "id":19,
            "name":"Soccer",
            "icon":null,
            "display_flag":1,
            "order":0,
            "requested_at":15821738127621
         },
         "requested_at":15821738127621
      },
      "requested_at":15821738127621
   },
   "1005312":{
      "id":1005312,
      "name":"WNCAAB ",
      "start_date":"1970-01-01 00:00:00",
      "icon":null,
      "display_flag":1,
      "base_competition_id":1000215,
      "events":[
         {
            "id":1051924,
            "name":"Fordham Women & Davidson Women",
            "display_flag":1,
            "start_date":"2020-02-23 00:00:00",
            "competition_id":1005312,
            "market_count":1,
            "dst_uri":"",
            "teams":[
               {
                  "id":810,
                  "name":"Fordham Women",
                  "icon":null,
                  "display_flag":0,
                  "position":"home",
                  "requested_at":15821738127629
               },
               {
                  "id":2610,
                  "name":"Davidson Women",
                  "icon":null,
                  "display_flag":0,
                  "position":"away",
                  "requested_at":15821738127631
               }
            ],
            "markets":[
               {
                  "id":1051565,
                  "name":"Match Winner",
                  "line":0,
                  "market_status":"O",
                  "display_flag":1,
                  "market_type_id":1000022,
                  "event_id":1051924,
                  "note":"",
                  "boost_available":false,
                  "selections":[
                     {
                        "id":455973,
                        "name":"Draw",
                        "line":0,
                        "price":2,
                        "won":false,
                        "display_flag":1,
                        "selection_status_id":1,
                        "requested_at":15821738127649
                     },
                     {
                        "id":455974,
                        "name":"Away",
                        "line":0,
                        "price":3,
                        "won":false,
                        "display_flag":1,
                        "selection_status_id":1,
                        "requested_at":15821738127652
                     }
                  ],
                  "markettypegroup":{
                     "id":1,
                     "name":"More Markets",
                     "description":"Markets Types that have not been grouped",
                     "display_flag":1,
                     "icon":null,
                     "requested_at":15821738127654
                  },
                  "requested_at":15821738127654
               }
            ],
            "products":[
               {
                  "product_id":10,
                  "bet_type":null,
                  "product_code":"TBF",
                  "product_name":"TopBetta Fixed",
                  "fixed":true,
                  "available":true,
                  "product_image":null,
                  "ribbon_image":null,
                  "has_pool":false,
                  "product_description":"Guarantees to pay at least the best of the 3 TAB dividends",
                  "product_note":null,
                  "product_tooltip":null,
                  "background_colour":null,
                  "multi_available":false,
                  "ordinal":0,
                  "margin":0,
                  "product_type":"standard",
                  "price_id":0,
                  "pool_total":0,
                  "first_leg":null,
                  "requested_at":15821738127662
               }
            ],
            "requested_at":15821738127662
         },
         {
            "id":1051923,
            "name":"NC State Women & Louisville Women",
            "display_flag":1,
            "start_date":"2020-02-23 01:00:00",
            "competition_id":1005312,
            "market_count":1,
            "dst_uri":"",
            "teams":[
               {
                  "id":3114,
                  "name":"NC State Women",
                  "icon":null,
                  "display_flag":0,
                  "position":"home",
                  "requested_at":15821738127668
               },
               {
                  "id":3115,
                  "name":"Louisville Women",
                  "icon":null,
                  "display_flag":0,
                  "position":"away",
                  "requested_at":15821738127670
               }
            ],
            "markets":[
               {
                  "id":1051564,
                  "name":"Match Winner",
                  "line":0,
                  "market_status":"O",
                  "display_flag":1,
                  "market_type_id":1000022,
                  "event_id":1051923,
                  "note":"",
                  "boost_available":false,
                  "selections":[
                     {
                        "id":455970,
                        "name":"Draw",
                        "line":0,
                        "price":2,
                        "won":false,
                        "display_flag":1,
                        "selection_status_id":1,
                        "requested_at":15821738127688
                     },
                     {
                        "id":455971,
                        "name":"Away",
                        "line":0,
                        "price":3,
                        "won":false,
                        "display_flag":1,
                        "selection_status_id":1,
                        "requested_at":15821738127691
                     }
                  ],
                  "markettypegroup":{
                     "id":1,
                     "name":"More Markets",
                     "description":"Markets Types that have not been grouped",
                     "display_flag":1,
                     "icon":null,
                     "requested_at":15821738127693
                  },
                  "requested_at":15821738127693
               }
            ],
            "products":[
               {
                  "product_id":10,
                  "bet_type":null,
                  "product_code":"TBF",
                  "product_name":"TopBetta Fixed",
                  "fixed":true,
                  "available":true,
                  "product_image":null,
                  "ribbon_image":null,
                  "has_pool":false,
                  "product_description":"Guarantees to pay at least the best of the 3 TAB dividends",
                  "product_note":null,
                  "product_tooltip":null,
                  "background_colour":null,
                  "multi_available":false,
                  "ordinal":0,
                  "margin":0,
                  "product_type":"standard",
                  "price_id":0,
                  "pool_total":0,
                  "first_leg":null,
                  "requested_at":15821738127701
               }
            ],
            "requested_at":15821738127701
         }
      ],
      "base_competition":{
         "id":1000215,
         "name":"WNCAAB",
         "icon":null,
         "display_flag":1,
         "sport_id":13,
         "order":0,
         "sport":{
            "id":13,
            "name":"Basketball",
            "icon":null,
            "display_flag":1,
            "order":0,
            "requested_at":15821738127706
         },
         "requested_at":15821738127706
      },
      "requested_at":15821738127706
   },
   "1006033":{
      "id":1006033,
      "name":"Iran Pro League 20",
      "start_date":"2020-02-23 12:00:00",
      "icon":null,
      "display_flag":null,
      "base_competition_id":1000161,
      "events":[
         {
            "id":1051925,
            "name":"Peykan & Foolad Khuzestan",
            "display_flag":1,
            "start_date":"2020-02-23 12:00:00",
            "competition_id":1006033,
            "market_count":1,
            "dst_uri":"",
            "teams":[
               {
                  "id":3116,
                  "name":"Peykan",
                  "icon":null,
                  "display_flag":0,
                  "position":"home",
                  "requested_at":15821738127713
               },
               {
                  "id":696,
                  "name":"Foolad Khuzestan",
                  "icon":null,
                  "display_flag":0,
                  "position":"away",
                  "requested_at":15821738127716
               }
            ],
            "markets":[
               {
                  "id":1051566,
                  "name":"Match Winner",
                  "line":0,
                  "market_status":"O",
                  "display_flag":1,
                  "market_type_id":1000022,
                  "event_id":1051925,
                  "note":"",
                  "boost_available":false,
                  "selections":[
                     {
                        "id":455976,
                        "name":"Draw",
                        "line":0,
                        "price":2,
                        "won":false,
                        "display_flag":1,
                        "selection_status_id":1,
                        "requested_at":15821738127733
                     },
                     {
                        "id":455977,
                        "name":"Away",
                        "line":0,
                        "price":3,
                        "won":false,
                        "display_flag":1,
                        "selection_status_id":1,
                        "requested_at":15821738127736
                     }
                  ],
                  "markettypegroup":{
                     "id":1,
                     "name":"More Markets",
                     "description":"Markets Types that have not been grouped",
                     "display_flag":1,
                     "icon":null,
                     "requested_at":15821738127739
                  },
                  "requested_at":15821738127739
               }
            ],
            "products":[
               {
                  "product_id":10,
                  "bet_type":null,
                  "product_code":"TBF",
                  "product_name":"TopBetta Fixed",
                  "fixed":true,
                  "available":true,
                  "product_image":null,
                  "ribbon_image":null,
                  "has_pool":false,
                  "product_description":"Guarantees to pay at least the best of the 3 TAB dividends",
                  "product_note":null,
                  "product_tooltip":null,
                  "background_colour":null,
                  "multi_available":false,
                  "ordinal":0,
                  "margin":0,
                  "product_type":"standard",
                  "price_id":0,
                  "pool_total":0,
                  "first_leg":null,
                  "requested_at":15821738127747
               }
            ],
            "requested_at":15821738127747
         }
      ],
      "base_competition":{
         "id":1000161,
         "name":"Iran Pro League",
         "icon":null,
         "display_flag":"1",
         "sport_id":19,
         "order":0,
         "sport":{
            "id":19,
            "name":"Soccer",
            "icon":null,
            "display_flag":1,
            "order":0,
            "requested_at":15821738127751
         },
         "requested_at":15821738127751
      },
      "requested_at":15821738127751
   }
}


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2SI5Vwf
via IFTTT

Aucun commentaire:

Enregistrer un commentaire