I currently have a PHP function which makes a GET request to Google Places API in order to get the details for a place based on the id of that place.
public function getSight(Request $request, $placeid) {
$get = file_get_contents("https://maps.googleapis.com/maps/api/place/details/json?placeid=" . $placeid . "&key=");
$result = json_decode($get);
return response()->json([
'message' => 'Fetched sight!',
'result' => $result
], 201);
}
This is all good and dandy, however, now I want to expand the functionality of my application by allowing users to save the IDs of places they like in the database and then display all liked places on a certain page. Does this mean I'd have to literally run 10 GET requests if the user has liked 10 places? Would that be extremely slow, especially if the user has like 20, 30 or 100 places? I'm reading the Google Places API documentation and I can't find any information about getting more than 1 place details using a single GET request.
Surely there's a better way for me to accomplish this.