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

ActiveLibrary[API Development](/categories/api)

vdvcoder/geocode
================

Google Geocoding API for Laravel

1.0(3y ago)028MITPHPPHP ^8.0|^8.1

Since Aug 22Pushed 3y agoCompare

[ Source](https://github.com/vdvcoder/geocode)[ Packagist](https://packagist.org/packages/vdvcoder/geocode)[ RSS](/packages/vdvcoder-geocode/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

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

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

[![Latest Stable Version](https://camo.githubusercontent.com/17c7a5ad41730a92f8a6835e26d00ccd06c5e25307f67797dc7a0feb4eaf8d71/68747470733a2f2f706f7365722e707567782e6f72672f766476636f6465722f67656f636f64652f762f737461626c652e737667)](https://packagist.org/packages/vdvcoder/geocode) [![Total Downloads](https://camo.githubusercontent.com/87f342bcc62eeca1f23a501f2cbcc7e383714c64a521b3299b2549f886c7fbf9/68747470733a2f2f706f7365722e707567782e6f72672f766476636f6465722f67656f636f64652f646f776e6c6f6164732e737667)](https://packagist.org/packages/vdvcoder/geocode) [![License](https://camo.githubusercontent.com/ae5f8152ae1eb96aad88a03aac3a0157d208e7c96303720f95e6f0930887dcf7/68747470733a2f2f706f7365722e707567782e6f72672f766476636f6465722f67656f636f64652f6c6963656e73652e737667)](https://packagist.org/packages/vdvcoder/geocode) [![PHP Version Require](https://camo.githubusercontent.com/d44ba9c62be962c01be5fa70b750447e13d8b02b5db5d308168e456f31c4dce5/687474703a2f2f706f7365722e707567782e6f72672f766476636f6465722f67656f636f64652f726571756972652f706870)](https://packagist.org/packages/vdvcoder/geocode)

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 vdvcoder/geocode
```

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:

```
$response = Geocode::make()->address('1 Infinite Loop');

if ($response) {
	echo $response->latitude();
	echo $response->longitude();
	echo $response->formattedAddress();
	echo $response->locationType();
}

// Output
// 37.331741
// -122.0303329
// 1 Infinite Loop, Cupertino, CA 95014, USA
// ROOFTOP
```

Or from latitude/longitude:

```
$response = Geocode::make()->latLng(40.7637931,-73.9722014);
if ($response) {
	echo $response->latitude();
	echo $response->longitude();
	echo $response->formattedAddress();
	echo $response->locationType();
}

// Output
// 40.7637931
// -73.9722014
// 767 5th Avenue, New York, NY 10153, USA
// ROOFTOP
```

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

```
$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'];
}

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

That's it. Pull requests are welcome.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50.9% 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

Unknown

Total

1

Last Release

1365d ago

### Community

Maintainers

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

---

Top Contributors

[![jotafurtado](https://avatars.githubusercontent.com/u/748350?v=4)](https://github.com/jotafurtado "jotafurtado (28 commits)")[![jpmurray](https://avatars.githubusercontent.com/u/1550428?v=4)](https://github.com/jpmurray "jpmurray (8 commits)")[![djereg](https://avatars.githubusercontent.com/u/6384768?v=4)](https://github.com/djereg "djereg (6 commits)")[![vdvcoder](https://avatars.githubusercontent.com/u/13916116?v=4)](https://github.com/vdvcoder "vdvcoder (5 commits)")[![DougSisk](https://avatars.githubusercontent.com/u/70512?v=4)](https://github.com/DougSisk "DougSisk (2 commits)")[![brino](https://avatars.githubusercontent.com/u/986822?v=4)](https://github.com/brino "brino (2 commits)")[![grumpysi](https://avatars.githubusercontent.com/u/6876914?v=4)](https://github.com/grumpysi "grumpysi (1 commits)")[![dave-miller](https://avatars.githubusercontent.com/u/1550539?v=4)](https://github.com/dave-miller "dave-miller (1 commits)")[![Niellles](https://avatars.githubusercontent.com/u/10075507?v=4)](https://github.com/Niellles "Niellles (1 commits)")[![thsteinmetz](https://avatars.githubusercontent.com/u/4640652?v=4)](https://github.com/thsteinmetz "thsteinmetz (1 commits)")

---

Tags

apilaravelgeocodingaddressgooglelatitudelongitudegeocode

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/vdvcoder-geocode/health.svg)](https://phpackages.com/packages/vdvcoder-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)
