Skip to content

Commit b41ad65

Browse files
authored
Merge pull request #19 from TappNetwork/add_language_on_place_details
Add language in Place Details
2 parents 397efd6 + dc0bd25 commit b41ad65

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Concerns/HasGooglePlaceApi.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,17 @@ protected function getPlace(string $placeId)
9191
{
9292
$this->setGoogleApi();
9393

94-
$addressData = $this->googlePlaces->placeDetails($placeId);
94+
$detailParams = [];
9595

96-
return $addressData;
96+
if ($this->placesApiNew) {
97+
$detailParams['languageCode'] = $this->params['languageCode'] ?? null;
98+
99+
return $this->googlePlaces->placeDetails($placeId, ['*'], $detailParams);
100+
}
101+
102+
$detailParams['language'] = $this->params['language'] ?? null;
103+
104+
return $this->googlePlaces->placeDetails($placeId, $detailParams);
97105
}
98106

99107
protected function getFormattedApiResults($data): array

0 commit comments

Comments
 (0)