PHPackages                             farhanwazir/laravelgooglemaps - 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. farhanwazir/laravelgooglemaps

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

farhanwazir/laravelgooglemaps
=============================

Laravel Google Map package for 5.x. You can use all google map features in laravel.

2.3.9(8y ago)15542.0k109[17 issues](https://github.com/farhanwazir/laravelgooglemaps/issues)[2 PRs](https://github.com/farhanwazir/laravelgooglemaps/pulls)2MITPHPPHP &gt;=5.6.0CI failing

Since May 4Pushed 4y ago14 watchersCompare

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

READMEChangelog (10)Dependencies (1)Versions (17)Used By (2)

Laravel Google Maps
===================

[](#laravel-google-maps)

[![Rank](https://camo.githubusercontent.com/8276b54e0375562820936fa30ff24cab9e31e114ddec194b8582dd7440e7acf8/68747470733a2f2f7068707061636b616765732e6f72672f702f66617268616e77617a69722f6c61726176656c676f6f676c656d6170732f62616467652f72616e6b2e737667)](http://phppackages.org/p/farhanwazir/laravelgooglemaps)[![Total Downloads](https://camo.githubusercontent.com/5b31e334c71403da1b928c6f2e42090827b22abca5f0ed1631af65423b73e4aa/68747470733a2f2f706f7365722e707567782e6f72672f66617268616e77617a69722f6c61726176656c676f6f676c656d6170732f642f746f74616c2e737667)](https://packagist.org/packages/farhanwazir/laravelgooglemaps)[![Latest Stable Version](https://camo.githubusercontent.com/9658276598c8b4eb2d131001bf8eed4f95c21850a0ca53098beb83da90508f82/68747470733a2f2f706f7365722e707567782e6f72672f66617268616e77617a69722f6c61726176656c676f6f676c656d6170732f762f737461626c652e737667)](https://packagist.org/packages/farhanwazir/laravelgooglemaps)[![Latest Unstable Version](https://camo.githubusercontent.com/b8803f11df27756056faccb486eff87782d97c6615bf253d738cff69a89ba19b/68747470733a2f2f706f7365722e707567782e6f72672f66617268616e77617a69722f6c61726176656c676f6f676c656d6170732f762f756e737461626c652e737667)](https://packagist.org/packages/farhanwazir/laravelgooglemaps)[![License](https://camo.githubusercontent.com/1ae249309a1149430557b64e2b7c5a42150d395e4c47e019dc2866d81dfde411/68747470733a2f2f706f7365722e707567782e6f72672f66617268616e77617a69722f6c61726176656c676f6f676c656d6170732f6c6963656e73652e737667)](https://packagist.org/packages/farhanwazir/laravelgooglemaps)

This repo aims to use google map features in laravel 5.x. It is easy to use and flexible, you can just install this package and enjoy google map in your website and/or applications.

Features
--------

[](#features)

```
1. Localizing
2. Map Types
3. Custom Style
4. Makers
5. Info Window
6. Shapes
7. Symbols
8. Overlays
9. KML and GeoRSS
10. Traffic and Bicycling Layer
11. Geocoding Caches
12. Controls
13. Street View
14. Events
15. Reverse Geocoding
16. Travel Moding
17. Proxy

```

### Services &amp; Libraries

[](#services--libraries)

```
1. Directions
2. Geocoding
3. Geometry
4. Drawing
5. Places
6. Autocomplete
7. Adsense
8. Geofence (For now only server side geofence available)

```

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

[](#installation)

Add in composer.json

```
  "require": {
      "farhanwazir/laravelgooglemaps": "^2.3"
      ----
  }

```

Then

```
  composer update

```

Or install via composer cli

```
  composer require farhanwazir/laravelgooglemaps

```

Add service provider `config/app.php`

```
        FarhanWazir\GoogleMaps\GMapsServiceProvider::class,
```

And finally add in the alias section `config/app.php`

```
        'GMaps' => FarhanWazir\GoogleMaps\Facades\GMapsFacade::class,
```

Now publish configuration file

```
    php artisan vendor:publish --provider="FarhanWazir\GoogleMaps\GMapsServiceProvider"
```

\##Usage Example files are under FarhanWazir/GoogleMaps/Example:

Controller Example; reference code for display method

```
/******** Custom Map Controls ********/

        $leftTopControls = ['document.getElementById("leftTopControl")']; // values must be html or javascript element
        $this->gmap->injectControlsInLeftTop = $leftTopControls; // inject into map
        $leftCenterControls = ['document.getElementById("leftCenterControl")'];
        $this->gmap->injectControlsInLeftCenter = $leftCenterControls;
        $leftBottomControls = ['document.getElementById("leftBottomControl")'];
        $this->gmap->injectControlsInLeftBottom = $leftBottomControls;

        $bottomLeftControls = ['document.getElementById("bottomLeftControl")'];
        $this->gmap->injectControlsInBottomLeft = $bottomLeftControls;
        $bottomCenterControls = ['document.getElementById("bottomCenterControl")'];
        $this->gmap->injectControlsInBottomCenter = $bottomCenterControls;
        $bottomRightControls = ['document.getElementById("bottomRightControl")'];
        $this->gmap->injectControlsInBottomRight = $bottomRightControls;

        $rightTopControls = ['document.getElementById("rightTopControl")'];
        $this->gmap->injectControlsInRightTop = $rightTopControls;
        $rightCenterControls = ['document.getElementById("rightCenterControl")'];
        $this->gmap->injectControlsInRightCenter = $rightCenterControls;
        $rightBottomControls = ['document.getElementById("rightBottomControl")'];
        $this->gmap->injectControlsInRightBottom = $rightBottomControls;

        $topLeftControls = ['document.getElementById("topLeftControl")'];
        $this->gmap->injectControlsInTopLeft = $topLeftControls;
        $topCenterControls = ['document.getElementById("topCenterControl")'];
        $this->gmap->injectControlsInTopCenter = $topCenterControls;
        $topRightControls = ['document.getElementById("topRightControl")'];
        $this->gmap->injectControlsInTopRight = $topRightControls;

        /******** End Controls ********/

        $config = array();
        $config['map_height'] = "100%";
        $config['center'] = 'Clifton, Karachi';

        $this->gmap->initialize($config); // Initialize Map with custom configuration

        /*********** Marker Setup ***********/
        $marker = array();
        $marker['draggable'] = true;
        //Marker event dragend
        $marker['ondragend'] = '
        iw_'. $this->gmap->map_name .'.close();
        reverseGeocode(event.latLng, function(status, result, mark){
            if(status == 200){
                iw_'. $this->gmap->map_name .'.setContent(result);
                iw_'. $this->gmap->map_name .'.open('. $this->gmap->map_name .', mark);
            }
        }, this);
        ';
        $this->gmap->add_marker($marker);
        /*********** End Marker Setup ***********/

        $map = $this->gmap->create_map(); // This object will render javascript files and map view; you can call JS by $map['js'] and map view by $map['html']

        return view('map', ['map' => $map]);
```

Route Example

```
Route::get('/map', 'MapController@index');

Route::get('/', function(){
    $config = array();
    $config['center'] = 'New York, USA';
    GMaps::initialize($config);
    $map = GMaps::create_map();

    echo $map['js'];
    echo $map['html'];
});
```

View Example

```

        {!! $map['js'] !!}

                This is Left Top Control.

                This is Left Center Control.

                This is Left Bottom Control.

                This is Bottom Right Control.

                This is Bottom Center Control.

                This is Bottom Left Control.

                This is Right Top Control.

                This is Right Center Control.

                This is Right Bottom Control.

                This is Top Left Control.

                This is Top Center Control.

                This is Top Right Control.

            {!! $map['html'] !!}

```

### Geo-fence Example

[](#geo-fence-example)

```
$polygon = array("25.774,-80.190", "18.466,-66.118", "32.321,-64.757", "25.774,-80.190"); //start and end point should be same
$latlngs = array("-12.043333,-77.028333", "-12.043333,-77.028333");

GMaps::isMarkerInsideGeofence($polygon, $latlngs); //both parameters should be in array
//return will also in array with boolean values like: array(true, false)
```

Contribution
============

[](#contribution)

- Proxy feature by @grimseer - Nov 22, 2016
- Fixed to load google api via https by @wissamdagher - Apr 04, 2017
- Map full screen support by @wissamdagher - Jul 02, 2017
- Facade namespace fixed by @drehimself - Aug 03, 2017
- Fixed migration file name by @drehimself - Aug 03, 2017

Thank you for using!
====================

[](#thank-you-for-using)

If you like it then click Fork!

Contact me if any query or suggestion you have in support section.

Credits
=======

[](#credits)

Library initiative: **BioStall**

BioStall developed library for codeigniter originally, which you can found at

Conversion into Laravel from codeigniter by: **GeneaLabs** --  (but it is incomplete)

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 91.6% 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 ~91 days

Recently: every ~286 days

Total

16

Last Release

2287d ago

Major Versions

v1.8.0 → v2.1.12016-07-31

### Community

Maintainers

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

---

Top Contributors

[![farhanwazir](https://avatars.githubusercontent.com/u/241825?v=4)](https://github.com/farhanwazir "farhanwazir (76 commits)")[![drehimself](https://avatars.githubusercontent.com/u/4316355?v=4)](https://github.com/drehimself "drehimself (5 commits)")[![grimzy](https://avatars.githubusercontent.com/u/1837678?v=4)](https://github.com/grimzy "grimzy (1 commits)")[![wixyskywriter](https://avatars.githubusercontent.com/u/5904398?v=4)](https://github.com/wixyskywriter "wixyskywriter (1 commits)")

---

Tags

google-mapslaravellaravelgooglemapgooglemapgmap

### Embed Badge

![Health badge](/badges/farhanwazir-laravelgooglemaps/health.svg)

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

###  Alternatives

[spatie/laravel-analytics

A Laravel package to retrieve Google Analytics data.

3.2k5.7M57](/packages/spatie-laravel-analytics)[cornford/googlmapper

An easy way to integrate Google Maps with Laravel.

457447.9k4](/packages/cornford-googlmapper)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[cornford/googlitics

An easy way to integrate Google Analytics with Laravel.

3310.2k](/packages/cornford-googlitics)[yieldstudio/nova-google-autocomplete

A Laravel Nova Google autocomplete field.

12218.4k](/packages/yieldstudio-nova-google-autocomplete)

PHPackages © 2026

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