Hi everyone I want to ask
I have json data like this:
[
{
"data": [
{
"id": "01",
"name": "name 1",
"email": "[email protected]",
"created_at": "2020-08-31T03:52:30",
"user_roles": [
{
"id": "111",
"name": "General"
}
]
},
{
"id": "02",
"name": "name 2",
"email": "[email protected]",
"created_at": "2020-08-31T03:52:30",
"user_roles": [
{
"id": "111",
"name": "General"
}
]
},
{
"id": "03",
"name": "name 3",
"email": "[email protected]",
"created_at": "2020-08-31T03:52:30",
"user_roles": [
{
"id": "222",
"name": "Supervisor"
}
]
}
]
}
]
How to filter the json data based on the user’s role is General?
So the results I will get like this
[
{
"data": [
{
"id": "01",
"name": "name 1",
"email": "[email protected]",
"created_at": "2020-08-31T03:52:30",
"user_roles": [
{
"id": "111",
"name": "General"
}
]
},
{
"id": "02",
"name": "name 2",
"email": "[email protected]",
"created_at": "2020-08-31T03:52:30",
"user_roles": [
{
"id": "111",
"name": "General"
}
]
}
]
}
]
Thank you very much for your answer