Cevabınız için çok teşekkür ederim. Son bir sorum var.
$collection->groupBy('categoryprop.type');
Collection'nun içerisindeki kategoriler ve bunların içerisindeki sonsuz sayıda alt kategori ve alt kategori içerisindeki alt kategorilerdeki "categoryprop" içerisindeki "type"e göre nasıl getirebilirim?
[
{
"id":1,
"parrent_id":null,
"order":0,
"name":"Switch",
"slug":"switch",
"type":"switch",
"status":"1",
"created_at":null,
"updated_at":null,
"subcategory":[
],
"categoryprop":[
]
},
{
"id":2,
"parrent_id":null,
"order":1,
"name":"vlan",
"slug":"vlan",
"type":"vlan",
"status":"1",
"created_at":null,
"updated_at":null,
"subcategory":[
{
"id":3,
"parrent_id":2,
"order":0,
"name":"plan",
"slug":"plan",
"type":"vlan",
"status":"1",
"created_at":null,
"updated_at":null,
"subcategory":[
{
"id":15,
"parrent_id":3,
"order":0,
"name":"svlan",
"slug":"svlan",
"type":"vlan",
"status":"1",
"created_at":null,
"updated_at":null,
"subcategory":[
],
"categoryprop":[
{
"id":3,
"category_id":15,
"order":0,
"type":"menudesc",
"name":"menu aciklama",
"created_at":"2022-09-09T16:37:02.000000Z",
"updated_at":"2022-09-09T16:37:02.000000Z",
"categorycontent":[
{
"id":5,
"categoryprop_id":3,
"title":"dene",
"content":"denedim",
"image":null,
"lang_id":1,
"created_at":"2022-09-09T16:37:02.000000Z",
"updated_at":"2022-09-09T16:37:02.000000Z",
"lang":{
"id":1,
"name":"Turkish",
"symbol":"TR",
"code":"tr",
"default":1,
"created_at":null,
"updated_at":null
}
},
{
"id":6,
"categoryprop_id":3,
"title":"deneme",
"content":"denedim",
"image":null,
"lang_id":2,
"created_at":"2022-09-09T16:37:02.000000Z",
"updated_at":"2022-09-09T16:37:02.000000Z",
"lang":{
"id":2,
"name":"English",
"symbol":"EN",
"code":"en_us",
"default":0,
"created_at":null,
"updated_at":null
}
}
]
},
{
"id":4,
"category_id":3,
"order":0,
"type":"menudesc",
"name":"menu aciklamasi",
"created_at":"2022-09-09T16:37:02.000000Z",
"updated_at":"2022-09-09T16:37:02.000000Z",
"categorycontent":[
{
"id":7,
"categoryprop_id":4,
"title":"denek",
"content":"deneme",
"image":null,
"lang_id":1,
"created_at":"2022-09-09T16:37:02.000000Z",
"updated_at":"2022-09-09T16:37:02.000000Z",
"lang":{
"id":1,
"name":"Turkish",
"symbol":"TR",
"code":"tr",
"default":1,
"created_at":null,
"updated_at":null
}
},
{
"id":8,
"categoryprop_id":4,
"title":"deniyorum",
"content":"denicem",
"image":null,
"lang_id":2,
"created_at":"2022-09-09T16:37:02.000000Z",
"updated_at":"2022-09-09T16:37:02.000000Z",
"lang":{
"id":2,
"name":"English",
"symbol":"EN",
"code":"en_us",
"default":0,
"created_at":null,
"updated_at":null
}
}
]
}
]
}
],
"categoryprop":[
{
"id":1,
"category_id":3,
"order":0,
"type":"menudesc",
"name":"menu aciklamasi",
"created_at":"2022-09-09T16:37:02.000000Z",
"updated_at":"2022-09-09T16:37:02.000000Z",
"categorycontent":[
{
"id":1,
"categoryprop_id":1,
"title":"oldugaliba",
"content":"yapacagiz insallah",
"image":null,
"lang_id":1,
"created_at":"2022-09-09T16:37:02.000000Z",
"updated_at":"2022-09-09T16:37:02.000000Z",
"lang":{
"id":1,
"name":"Turkish",
"symbol":"TR",
"code":"tr",
"default":1,
"created_at":null,
"updated_at":null
}
},
{
"id":2,
"categoryprop_id":1,
"title":"su bir deneme",
"content":"o bir deneme",
"image":null,
"lang_id":2,
"created_at":"2022-09-09T16:37:02.000000Z",
"updated_at":"2022-09-09T16:37:02.000000Z",
"lang":{
"id":2,
"name":"English",
"symbol":"EN",
"code":"en_us",
"default":0,
"created_at":null,
"updated_at":null
}
}
]
},
{
"id":2,
"category_id":3,
"order":0,
"type":"menudesc",
"name":"menu aciklamasi",
"created_at":"2022-09-09T16:37:02.000000Z",
"updated_at":"2022-09-09T16:37:02.000000Z",
"categorycontent":[
{
"id":3,
"categoryprop_id":2,
"title":"sen bir denemesin",
"content":"sen bir deneme",
"image":null,
"lang_id":1,
"created_at":"2022-09-09T16:37:02.000000Z",
"updated_at":"2022-09-09T16:37:02.000000Z",
"lang":{
"id":1,
"name":"Turkish",
"symbol":"TR",
"code":"tr",
"default":1,
"created_at":null,
"updated_at":null
}
},
{
"id":4,
"categoryprop_id":2,
"title":"onlar bir deneme",
"content":"onlar bir deneme",
"image":null,
"lang_id":2,
"created_at":"2022-09-09T16:37:02.000000Z",
"updated_at":"2022-09-09T16:37:02.000000Z",
"lang":{
"id":2,
"name":"English",
"symbol":"EN",
"code":"en_us",
"default":0,
"created_at":null,
"updated_at":null
}
}
]
}
]
},
{
"id":4,
"parrent_id":2,
"order":1,
"name":"oyla",
"slug":"oyla",
"type":"electronic",
"status":"1",
"created_at":null,
"updated_at":null,
"subcategory":[
],
"categoryprop":[
]
},
{
"id":5,
"parrent_id":2,
"order":2,
"name":"camasir",
"slug":"camasir",
"type":"penye",
"status":"1",
"created_at":null,
"updated_at":null,
"subcategory":[
],
"categoryprop":[
]
},
{
"id":6,
"parrent_id":2,
"order":3,
"name":"ohannes",
"slug":"ohannes",
"type":"likra",
"status":"1",
"created_at":null,
"updated_at":null,
"subcategory":[
],
"categoryprop":[
]
},
{
"id":7,
"parrent_id":2,
"order":4,
"name":"guzel",
"slug":"guzel",
"type":"plastik",
"status":"1",
"created_at":null,
"updated_at":null,
"subcategory":[
],
"categoryprop":[
]
},
{
"id":8,
"parrent_id":2,
"order":5,
"name":"semsiye",
"slug":"semsiye",
"type":"plastik",
"status":"1",
"created_at":null,
"updated_at":null,
"subcategory":[
],
"categoryprop":[
]
}
]