Can you try formatting your code with ``` on the line before and after. Also please show the code you have so far for the query
Feb 18, 2020
15
Level 13
Query nested 2 layers deep collections in laravel
I have the following nested collection:
Collection {#1195
#items: array:2 [
"ip_address" => "192.168.1.89"
"supplier" => "HitchHiker"
"flights" => array:2 [
0 => Collection {#1196
#items: array:1 [
"id" => "3559ee11-fc99-4b43-a86f-67f0e3257f4c"
]
]
]
I want to query with respect to "id", Its the 2nd level nested collection.
I want to use "where" clause to query the collection with respect to "id". How can I do it.
data = $data->whre(''id", $id)
I can only do on the first level collection. How to do in the second level nested collection?
Please or to participate in this conversation.