PHPackages                             salmanzafar/laravel-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. salmanzafar/laravel-geocode

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

salmanzafar/laravel-geocode
===========================

A Laravel Library to find Lat and Long of a given Specific Address

v1.0.5(5y ago)153.9k↓50%4MITPHPPHP ^7.0 || ^7.1 || ^7.2 || ^7.3 || ^7.4CI failing

Since Jun 29Pushed 3y ago3 watchersCompare

[ Source](https://github.com/salmanzafar949/laravel-geocode)[ Packagist](https://packagist.org/packages/salmanzafar/laravel-geocode)[ Fund](https://www.buymeacoffee.com/salmanzafar949)[ Patreon](https://www.patreon.com/salmanzafar949)[ RSS](/packages/salmanzafar-laravel-geocode/feed)WikiDiscussions master Synced 1mo ago

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

laravel-geocode
===============

[](#laravel-geocode)

[![stars](https://camo.githubusercontent.com/a504a73a5ed7683cbb08c8ebe8ec1f07d55374c7fcad332ea40068b1a42c01f5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f73616c6d616e7a616661723934392f6c61726176656c2d67656f636f6465)](https://camo.githubusercontent.com/a504a73a5ed7683cbb08c8ebe8ec1f07d55374c7fcad332ea40068b1a42c01f5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f73616c6d616e7a616661723934392f6c61726176656c2d67656f636f6465)[![issues](https://camo.githubusercontent.com/33539e65a5286f9c11686b86a3484dce862227709ae7cfd8e29354fbaff17745/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f73616c6d616e7a616661723934392f6c61726176656c2d67656f636f6465)](https://camo.githubusercontent.com/33539e65a5286f9c11686b86a3484dce862227709ae7cfd8e29354fbaff17745/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f73616c6d616e7a616661723934392f6c61726176656c2d67656f636f6465)[![forks](https://camo.githubusercontent.com/62789ce6ad675e606daa2f60b1caa6d5ed7f6431d7a8a5722df449bc8d6fbcf7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f73616c6d616e7a616661723934392f6c61726176656c2d67656f636f6465)](https://camo.githubusercontent.com/62789ce6ad675e606daa2f60b1caa6d5ed7f6431d7a8a5722df449bc8d6fbcf7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f73616c6d616e7a616661723934392f6c61726176656c2d67656f636f6465)[![license](https://camo.githubusercontent.com/0c2819b772027bad541859c264ec88fc7290db7db4e51cc02e173dc1a5618878/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f73616c6d616e7a616661723934392f6c61726176656c2d67656f636f6465)](https://camo.githubusercontent.com/0c2819b772027bad541859c264ec88fc7290db7db4e51cc02e173dc1a5618878/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f73616c6d616e7a616661723934392f6c61726176656c2d67656f636f6465)[![Total Downloads](https://camo.githubusercontent.com/2831a4bf1d773beeade649481cbad1f70616f73e49100e85985705cad62baf82/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73616c6d616e7a616661722f6c61726176656c2d67656f636f64653f7374796c653d666c61742d737175617265)](https://packagist.org/packages/salmanzafar/laravel-geocode)

Laravel Package to get Lat and Long from Specific Address.

Table of contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)

Installation
============

[](#installation)

```
composer require salmanzafar/laravel-geocode
```

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

[](#configuration)

Publish the configuration file

```
php artisan vendor:publish --provider="Salman\GeoCode\GeoCodeServiceProvider"
```

Config/geocode.php
------------------

[](#configgeocodephp)

```
'API_KEY' => env('GOOGLE_GEOCODE_API_KEY', ''),

```

Enable the package (Optional)
-----------------------------

[](#enable-the-package-optional)

This package implements Laravel auto-discovery feature

Usage
-----

[](#usage)

You need a [Google map geocode](https://developers.google.com/maps/documentation/geocoding/intro) api key in order to use this

#### Finding Coordinates

[](#finding-coordinates)

```
use Salman\GeoCode\Services\GeoCode;

public function lookForPoints()
{
        $address = "1600 Amphitheatre Parkway,Mountain View";
        $getPoints = new GeoCode();
        return $getPoints->getLatAndLong($address);
}
```

#### Finding Coordinates using Facade

[](#finding-coordinates-using-facade)

```
use GeoCode;

public function lookForPoints()
{
    $address = "1600 Amphitheatre Parkway,Mountain View";
    return GeoCode::getLatAndLong($address);
}
```

#### Finding Coordinates using Helper Function

[](#finding-coordinates-using-helper-function)

```
public function lookForPoints()
{
    $address = "1600 Amphitheatre Parkway,Mountain View";
    return findAddressCoordinates($address);
}
```

#### Response

[](#response)

##### It will return a Laravel collection as response

[](#it-will-return-a-laravel-collection-as-response)

```
{
    "address_components": [
        {
            "long_name": "1600",
            "short_name": "1600",
            "types": [
                "street_number"
            ]
        },
        {
            "long_name": "Amphitheatre Parkway",
            "short_name": "Amphitheatre Pkwy",
            "types": [
                "route"
            ]
        },
        {
            "long_name": "Mountain View",
            "short_name": "Mountain View",
            "types": [
                "locality",
                "political"
            ]
        },
        {
            "long_name": "Santa Clara County",
            "short_name": "Santa Clara County",
            "types": [
                "administrative_area_level_2",
                "political"
            ]
        },
        {
            "long_name": "California",
            "short_name": "CA",
            "types": [
                "administrative_area_level_1",
                "political"
            ]
        },
        {
            "long_name": "United States",
            "short_name": "US",
            "types": [
                "country",
                "political"
            ]
        },
        {
            "long_name": "94043",
            "short_name": "94043",
            "types": [
                "postal_code"
            ]
        }
    ],
    "formatted_address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
    "geometry": {
        "location": {
            "lat": 37.4220579,
            "lng": -122.0840897
        },
        "location_type": "ROOFTOP",
        "viewport": {
            "northeast": {
                "lat": 37.42340688029149,
                "lng": -122.0827407197085
            },
            "southwest": {
                "lat": 37.4207089197085,
                "lng": -122.0854386802915
            }
        }
    },
    "place_id": "ChIJtYuu0V25j4ARwu5e4wwRYgE",
    "plus_code": {
        "compound_code": "CWC8+R9 Mountain View, CA, USA",
        "global_code": "849VCWC8+R9"
    },
    "types": [
        "street_address"
    ]
}
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 95.7% 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 ~21 days

Recently: every ~26 days

Total

6

Last Release

2039d ago

PHP version history (3 changes)v1.0.0PHP &gt;=7.0.0

v1.0.4PHP &gt;=7.3.0

v1.0.5PHP ^7.0 || ^7.1 || ^7.2 || ^7.3 || ^7.4

### Community

Maintainers

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

---

Top Contributors

[![salmanzafar40](https://avatars.githubusercontent.com/u/29972877?v=4)](https://github.com/salmanzafar40 "salmanzafar40 (22 commits)")[![salmanzafar949](https://avatars.githubusercontent.com/u/29015432?v=4)](https://github.com/salmanzafar949 "salmanzafar949 (1 commits)")

---

Tags

composerlaravellaravel-packagephpphplaravellaravel5laravel6laravel8laravel7php-7.4php 7.0php 7.1php 7.2php 7.3geocode-laravellaravel-geocodegoogle maps laravel geocodegoogle maps laravel geocoder

### Embed Badge

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

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

###  Alternatives

[salmanzafar/laravel-mqtt

A simple Laravel Library to connect/publish/subscribe to MQTT broker

106153.1k1](/packages/salmanzafar-laravel-mqtt)[imanghafoori/laravel-terminator

A minimal yet powerful package to give you opportunity to refactor your controllers.

25353.0k](/packages/imanghafoori-laravel-terminator)[brexis/laravel-workflow

Integerate Symfony Workflow component into Laravel.

283125.6k](/packages/brexis-laravel-workflow)[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)[salmanzafar/laravel-geo-fence

A Laravel Library to calculate distance between two longitude and latitudes

157.3k1](/packages/salmanzafar-laravel-geo-fence)

PHPackages © 2026

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