Hello,
I have a below array and need to filter the array using laravel collection based on post.type
[
[
"name" => "abc",
"email" => "[email protected]",
"post" => [
"id" => 3,
"type" => 1,
"title" => "hello"
]
],
[
"name" => "abc",
"email" => "[email protected]",
"post" => [
"id" => 4,
"type" => 2,
"title" => "hello"
]
],
[
"name" => "abc",
"email" => "[email protected]",
"post" => [
"id" => 5,
"type" => 1,
"title" => "hello"
]
],
[
"name" => "abc",
"email" => "[email protected]",
"post" => [
"id" => 6,
"type" => 2,
"title" => "hello"
]
]
]
based on post type = 2 where condition need a following data
[
[
"name" => "abc",
"email" => "[email protected]",
"post" => [
"id" => 4,
"type" => 2,
"title" => "hello"
]
],
[
"name" => "abc",
"email" => "[email protected]",
"post" => [
"id" => 6,
"type" => 2,
"title" => "hello"
]
]
]
please let me know how I can achieve this