mardi 11 décembre 2018

How to get (parse) this JSON in Laravel?

Now I get POST data in JSON format like:

if ($request->filled('Countries')) {
    dd($request->Countries);
}

Where $request->Countries is array is sent from client:

"Countries": [2,15] 

What if I want to send the following JSON format:

{
   "places": [{"country": 1, "city": 1}, {"country": 1, "city": 2}]
}

How to get this data using request in Laravel and handle it?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire