Can someone teach me how can i access each of the category element in the data array?? PS: I post this JSON using Postman and try to manipulate it in a laravel project controller method.
There is no problem with my routes as i have successful using get and post request for other simple process.
I also use Content-Type with application/json header to send this JSON using the Postman software.
My laravel controller method:
public function requestStore(Request $request) {
//
}
JSON:
{
"id": "126612213872902",
"name": "Jack Daniel",
"likes": {
"data": [
{
"category": "Steakhouse",
"id": "330668300343348"
},
{
"category": "Steakhouse",
"id": "793734850733472"
},
{
"category": "Steakhouse",
"id": "650634241797601"
},
{
"category": "Steakhouse",
"id": "146621545355340"
},
{
"category": "Italian Restaurant",
"id": "146805911480"
},
{
"category": "Ice Cream Shop",
"id": "545851225458015"
},
{
"category": "Fast Food Restaurant",
"id": "24540959832"
},
{
"category": "Fast Food Restaurant",
"id": "478890372318431"
},
{
"category": "Fast Food Restaurant",
"id": "78934590040"
},
{
"category": "Korean Restaurant",
"id": "553600018012159"
},
{
"category": "Korean Restaurant",
"id": "388180681558608"
},
{
"category": "Chinese Restaurant",
"id": "288066224573571"
},
{
"category": "Chinese Restaurant",
"id": "77730698813"
},
{
"category": "Steakhouse",
"id": "80555139083"
},
{
"category": "Steakhouse",
"id": "276973702580"
},
{
"category": "Halal Restaurant",
"id": "407606596237025"
},
{
"category": "Malaysian Restaurant",
"id": "337074526415500"
},
{
"category": "Malaysian Restaurant",
"id": "607366992933940"
},
{
"category": "Malaysian Restaurant",
"id": "523902944321612"
},
{
"category": "Malaysian Restaurant",
"id": "194113415406"
},
{
"category": "Malaysian Restaurant",
"id": "177159752316413"
},
{
"category": "Malaysian Restaurant",
"id": "705777492887089"
},
{
"category": "Malaysian Restaurant",
"id": "1545544055681553"
},
{
"category": "Steakhouse",
"id": "558487800860920"
},
{
"category": "Steakhouse",
"id": "129509727619"
}
],
"paging": {
"cursors": {
"before": "MzMwNjY4MzAwMzQzMzQ4",
"after": "MTI5NTA5NzI3NjE5"
}
}
}
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire