PHPackages                             rentloop/google-geo-code - 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. rentloop/google-geo-code

ActiveLibrary[API Development](/categories/api)

rentloop/google-geo-code
========================

A Google Geo location API wrapper

1.0.0(5y ago)0351MITPHP

Since Jul 10Pushed 5y ago1 watchersCompare

[ Source](https://github.com/rentloop/google-geo-code)[ Packagist](https://packagist.org/packages/rentloop/google-geo-code)[ Docs](https://github.com/tjefford/google-geo-code)[ RSS](/packages/rentloop-google-geo-code/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

Google Geocode Wrapper
======================

[](#google-geocode-wrapper)

A small package to use google's geocode look up of an address.

Installation
------------

[](#installation)

This package has been tested on Laravel 5.4 and up.

You can install the package via composer:

```
composer require tjefford/google-geo-code

```

In Laravel 5.5 the service provider will automatically get registered. In older versions of the framework just add the service provider and facade in config/app.php file:

```
'providers' => [
    // ...
    Tjefford\GoogleGeoCode\GoogleGeoCodeServiceProvider::class,
];

'aliases' => [
    // ...
    'Lookup' => Tjefford\GoogleGeoCode\Facades\Lookup::class,
];
```

### Environment

[](#environment)

This package uses an environment key to pull a secret API token from your `.env` file. You will need to get a API key from [Google Geocode API](https://developers.google.com/maps/documentation/geocoding/start) and put that key in your environment file as:

```
GOOGLE_GEOCODE_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

```

Usage
-----

[](#usage)

Using the lookup is very simple. All you need to provide is the address, city and state (for better accuracy). You will then be returned an array of data about that location from google.

Include the Lookup class in your file.

```
use Tjefford\GoogleGeoCode\Lookup;
```

Initiate the class and then call the locate method.

```
$lookup = new Lookup;
$lookup->locate('1901 W Madison St', 'Chicago', 'IL');
```

Your response should look similar to this

```
[
  "formatted_address" => "1901 W Madison St, Chicago, IL 60612, USA"
  "place_id" => "ChIJTeP2tz4tDogRADDUGhbXDB8"
  "neighborhood" => "Near West Side"
  "address" => "1901 West Madison Street"
  "city" => "Chicago"
  "state" => "Illinois"
  "postal_code" => "60612"
  "county" => "Cook County"
  "country" => "United States"
  "lat" => 41.8806285
  "lng" => -87.6740482
]

```

### Methods

[](#methods)

There is just 1 method that you can use, which is `locate`. It accepts 3 parameters, the first being the only required parameter.

ParameterRequiredDescriptionaddresstrueThe address of the location you want to gather data on. It can be anything and Google will attempt to find it.cityfalseFor better accuracy, you can add a city to the address by adding it here.statefalseFor better accuracy, you can add a state to the address by adding it here.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~237 days

Total

4

Last Release

2154d ago

Major Versions

0.2.0 → 1.0.02020-06-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/0524db4cfb332cc2d7f3b56ecbde02c96b3257d9f21fcea2a8987fffbfc75012?d=identicon)[tjefford](/maintainers/tjefford)

---

Top Contributors

[![tjefford](https://avatars.githubusercontent.com/u/2631747?v=4)](https://github.com/tjefford "tjefford (13 commits)")

### Embed Badge

![Health badge](/badges/rentloop-google-geo-code/health.svg)

```
[![Health](https://phpackages.com/badges/rentloop-google-geo-code/health.svg)](https://phpackages.com/packages/rentloop-google-geo-code)
```

###  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)
