mardi 29 janvier 2019

How can I fetch from multi level array in Laravel eloquent?

My question is about fetching data from multi level array what is generated from Laravel Groupby method ( Eloquent) .

-array

array:1 [▼
  1 => array:3 [▼
    4 => array:1 [▼
      2 => array:7 [▼
        0 => array:7 [▶]
        1 => array:7 [▶]
        2 => array:7 [▶]
        3 => array:7 [▶]
        4 => array:7 [▶]
        5 => array:7 [▶]
        6 => array:7 [▶]
      ]
    ]
    3 => array:1 [▼
      1 => array:1 [▼
        0 => array:7 [▶]
      ]
    ]
    2 => array:1 [▼
      1 => array:1 [▼
        0 => array:7 [▶]
      ]
    ]
  ]
]


Actually my datatable is so-

{"4":{"2":[{"id":1,"technology_id":1,"subject_id":20,"session_id":4,"semester_id":2,"created_at":"2019-01-18 18:16:49","updated_at":"2019-01-18 18:16:49"},{"id":2,"technology_id":1,"subject_id":23,"session_id":4,"semester_id":2,"created_at":"2019-01-18 18:16:49","updated_at":"2019-01-18 18:16:49"},{"id":3,"technology_id":1,"subject_id":24,"session_id":4,"semester_id":2,"created_at":"2019-01-18 18:16:49","updated_at":"2019-01-18 18:16:49"},{"id":4,"technology_id":1,"subject_id":45,"session_id":4,"semester_id":2,"created_at":"2019-01-18 18:16:49","updated_at":"2019-01-18 18:16:49"},{"id":5,"technology_id":1,"subject_id":46,"session_id":4,"semester_id":2,"created_at":"2019-01-18 18:16:49","updated_at":"2019-01-18 18:16:49"},{"id":6,"technology_id":1,"subject_id":47,"session_id":4,"semester_id":2,"created_at":"2019-01-18 18:16:49","updated_at":"2019-01-18 18:16:49"},{"id":7,"technology_id":1,"subject_id":48,"session_id":4,"semester_id":2,"created_at":"2019-01-18 18:16:49","updated_at":"2019-01-18 18:16:49"}]},"3":{"1":[{"id":8,"technology_id":1,"subject_id":1,"session_id":3,"semester_id":1,"created_at":"2019-01-18 18:18:27","updated_at":"2019-01-18 18:18:27"}]},"2":{"1":[{"id":9,"technology_id":1,"subject_id":7,"session_id":2,"semester_id":1,"created_at":"2019-01-18 18:18:27","updated_at":"2019-01-18 18:18:27"}]}}

I expect view in html is so-

https://imgur.com/a/O03Iog0

Can anyone help?



from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2CUZRaq
via IFTTT

Aucun commentaire:

Enregistrer un commentaire