Closed mohammad6006 closed 6 years ago
Hi @mohammad6006,
Thank you for your question.
The response from Google Maps API call, if not explicitly set, is json
by default.
As per Laravel documentation, you would use following to return json
response
return response()->json([ 'name' => 'Abigail', 'state' => 'CA' ]);
In your case use following:
$response = \GoogleMaps::load('geocoding')
->setParam (['address' =>'santa cruz'])
->get();
return response()->json([$response]);
return json with html header
and I have to use :
to set header