Skip to content

Commit dc0bd25

Browse files
committed
Add language in Place Details
1 parent 397efd6 commit dc0bd25

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)