PHPackages                             jboilesen/googleplace - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. jboilesen/googleplace

ActiveLibrary[API Development](/categories/api)

jboilesen/googleplace
=====================

Google Places API library

1.1(8y ago)0191MITPHP

Since Jan 6Pushed 5y agoCompare

[ Source](https://github.com/jboilesen/googleplace)[ Packagist](https://packagist.org/packages/jboilesen/googleplace)[ RSS](/packages/jboilesen-googleplace/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (3)Used By (0)

PHP SDK for Google Places APIs
==============================

[](#php-sdk-for-google-places-apis)

Location aware web application uses google-places-api([Place Search](http://github.com), [Place Details](https://developers.google.com/places/web-service/details), [Geocoding](https://developers.google.com/maps/documentation/geocoding/start) , [Distance Matrix](https://developers.google.com/maps/documentation/distance-matrix/start), [Timezone](https://developers.google.com/maps/documentation/timezone/intro), [Elevation](https://developers.google.com/maps/documentation/elevation/start)) a lot. They are not linked to each other also its hard to find a easy and time saving php libraray to work with these api. These libraray will need less knowldege about google api and give you flavour of OOP.

### Setting

[](#setting)

Add this line on your composer.json

```
"require":{
    "digitaldream/googleplace":"1.*"
}
```

You need to set your google api keys on top of your page. Like below

```
   \GooglePlace\Request::$api_key = 'YOUR_GOOGLE_PLACES_API_KEY';
```

### Nearby Search

[](#nearby-search)

A Nearby Search lets you search for places within a specified area. For example you can search all the Restaurents of your city.

```
   $rankBy = new \GooglePlace\Services\Nearby([
            'location' => '23.823168,90.367728',
            'rankby' => 'distance',
            'type' => 'bank'
        ]
    );
    $rankBy->places(); // it will return \Collection each contains a object of GooglePlace\Service\Place
    /* Google Return 60 places divide by 20 each request.
     To get next 20 result you have to call nextPage method.
     */
     print_r($rankBy->nextPage()); // it will return \GooglePlace\Response
```

### Text Search

[](#text-search)

Text Search Service is a web service that returns information about a set of places based on a string — for example "pizza in New York"

```
  $textSearch = new \GooglePlace\Services\TextSearch([
  'query' => 'Restaurants in Mirpur'
  ]);
   $places = $textSearch->places(); //same as nearby
```

### Place Details

[](#place-details)

A Place Details request returns more comprehensive information about the indicated place such as its complete address, phone number, user rating and reviews. You need to pass place\_id or a reference from a Place Search

```
$place=new \GooglePlace\Service\Place([
 'placeid'=>'any place id'
]);
$place->get();
echo $place->address();
echo $place->phone();
print_r($place->photos()); // returns Collection each contains a GooglePlace\Helpers\PlacePhoto object
print_r($place->reviews()) // return Collection
print_r($place->timezone(true)); // return  Timezone API response
print_r($place->distance($place2)) // return Distance Matrix API response
print_r($place->elevation()) // return Elevation API response
```

### Geocoding

[](#geocoding)

You can get places by a place name or latitude and longitude.

```
 $geocoding = new \GooglePlace\Services\Geocoding([
        'address' => 'House 13,Road 10,Section 11,Mirpur,Dhaka'
    ]);
    print_r($geocoding->places());

  $reverseGeocoding=   new \GooglePlace\Services\Geocoding([
        'address' =>  'latlng' => '23.8163589,90.3709893'
    ]);
       print_r($reverseGeocoding->places()); //same as nearby
```

### Distance Matrix API

[](#distance-matrix-api)

Distance Matrix API is a service that provides travel distance and time for a matrix of origins and destinations, based on the recommended route between start and end points

```
 $distanceMatrix = new \GooglePlace\Services\DistanceMatrix([
        'origins' => ['Dhaka University, Dhaka'],
        'destinations' => ['National University of Bangldesh, Gazipur']]);

    print_r($distanceMatrix->calculate());
```

### Timezone API

[](#timezone-api)

Time Zone API provides time offset data for locations on the surface of the earth. The API returns the name of that time zone, the time offset from UTC, and the daylight savings offset.

```
 $timezone= new \GooglePlace\Services\Timezone([
    'location'=>'23.8163589,90.3709893',
    timestamp=time()
 ])
 $response=$timezone->get();
 echo $response->timeZoneId // return Asia/Dhaka
```

### Elevation API

[](#elevation-api)

Get the altitude(height from sea level in meters) of a given place.

```
$elevation =new \GooglePlace\Services\Elevation([
    'locations'=>'23.8163589,90.3709893'
]);
print_r($elevation->get());
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 69.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1133 days

Total

2

Last Release

1914d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a86dac3bc2974bbec9a3df28db38e1c448c1cee64d3e963388128756670f6031?d=identicon)[jboilesen](/maintainers/jboilesen)

---

Top Contributors

[![digitaldreams](https://avatars.githubusercontent.com/u/6059541?v=4)](https://github.com/digitaldreams "digitaldreams (18 commits)")[![jboilesen](https://avatars.githubusercontent.com/u/4542170?v=4)](https://github.com/jboilesen "jboilesen (8 commits)")

### Embed Badge

![Health badge](/badges/jboilesen-googleplace/health.svg)

```
[![Health](https://phpackages.com/badges/jboilesen-googleplace/health.svg)](https://phpackages.com/packages/jboilesen-googleplace)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
