PHPackages                             shumex/geocode - 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. shumex/geocode

ActiveLibrary[API Development](/categories/api)

shumex/geocode
==============

Google Geocode API for Laravel

1.0(8y ago)112MITPHPPHP &gt;=5.4.0

Since Dec 22Pushed 8y agoCompare

[ Source](https://github.com/DmytroShumeyko/Geocode)[ Packagist](https://packagist.org/packages/shumex/geocode)[ RSS](/packages/shumex-geocode/feed)WikiDiscussions master Synced 5d ago

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

Google Geocoding API for Laravel
================================

[](#google-geocoding-api-for-laravel)

A simple [Laravel](http://laravel.com/) service provider for Google Geocoding API.

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

[](#installation)

This package can be installed via [Composer](http://getcomposer.org).

Run composer require command.

```
composer require shumex/geocode
```

### Laravel 5.5

[](#laravel-55)

Both the service provider and alias will be automatically installed by Laravel 5.5 package discovery.

Configuration
-------------

[](#configuration)

Add the following line to the .env file:

```
GEOCODE_GOOGLE_APIKEY=
```

You can optionally set the response language.

```
GEOCODE_GOOGLE_LANGUAGE=en # pt-BR, es, de, it, fr, en-GB
```

[Supported Languages](https://developers.google.com/maps/faq?hl=en#languagesupport) for Google Maps Geocoding API.

Usage
-----

[](#usage)

You can find data from addresses:

```
try {
    $response = Geocode::make()->address('Saporischschja', 'de');
    if ($response) {
        echo $response->latitude();
        echo "";
        echo $response->longitude();
        echo "";
        echo $response->formattedAddress();
        echo "";
    }
} catch (GeoException $exception) {
    echo $exception->getMessage();
}

// Output
// 35.139567
// 47.8388
// Saporischschja, Ukraine, 69061
```

Or from latitude/longitude:

```
try {
    $response = Geocode::make()->latLng(47.850437, 35.135653, 'en');
    if ($response) {
        echo $response->latitude();
        echo "";
        echo $response->longitude();
        echo "";
        echo $response->formattedAddress();
        echo "";
    }
} catch (GeoException $exception) {
    echo $exception->getMessage();
}

// Output
// 47.850437
// 35.135653
// Volhohrads'ka St, 27, Zaporizhzhia, Zaporiz'ka oblast, Ukraine, 69000
```

If you need other data rather than formatted address, latitude, longitude, you can use the `raw()` method:

```
try {
    $response = Geocode::make()->latLng(40.7637931,-73.9722014);
    if ($response) {
        echo $response->raw()->address_components[8]['types'][0];
        echo $response->raw()->address_components[8]['long_name'];
    }
} catch (GeoException $exception) {
    echo $exception->getMessage();
}

// Output
// postal_code
// 10153
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity62

Established project with proven stability

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 ~0 days

Total

5

Last Release

3068d ago

Major Versions

0.4 → 1.02017-12-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/44eaf0572deae3cd315e2b3256c42491840a8e66cc6f1aba720653bd93e858ca?d=identicon)[dmytro.shumeyko](/maintainers/dmytro.shumeyko)

---

Tags

apilaravelgeocodingaddressgooglelatitudelongitudegeocode

### Embed Badge

![Health badge](/badges/shumex-geocode/health.svg)

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

###  Alternatives

[jcf/geocode

Google Geocoding API for Laravel

48160.5k](/packages/jcf-geocode)[jackmartin/laravel-yandex-geocode

Simply service laravel Yandex Geocoding

1016.6k](/packages/jackmartin-laravel-yandex-geocode)[1001pharmacies/geolocation-bundle

Provides an abstraction layer for geocoding services.

116.8k](/packages/1001pharmacies-geolocation-bundle)

PHPackages © 2026

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