PHPackages                             ghanem/google-map - 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. ghanem/google-map

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

ghanem/google-map
=================

Google Map with Places Autocomplete field for Laravel Nova 4 &amp; 5.

V3.0(2mo ago)852.0k↑315.2%MITVuePHP ^8.1CI failing

Since Oct 6Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/AbdullahGhanem/nova-google-map)[ Packagist](https://packagist.org/packages/ghanem/google-map)[ RSS](/packages/ghanem-google-map/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (7)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/19e9f058ad390f74d8ad08508576b330c37d945d7562940796c51755a04d9a9a/68747470733a2f2f706f7365722e707567782e6f72672f6768616e656d2f676f6f676c652d6d61702f762f737461626c652e737667)](https://packagist.org/packages/ghanem/google-map) [![License](https://camo.githubusercontent.com/3e890c293bc86dcaba4833b447c09d2e1c1fc43e5cb0f03c31a6a197802fa468/68747470733a2f2f706f7365722e707567782e6f72672f6768616e656d2f676f6f676c652d6d61702f6c6963656e73652e737667)](https://packagist.org/packages/ghanem/google-map) [![Total Downloads](https://camo.githubusercontent.com/c96d3c849ed0c1c7c7c714e4714e71047b5335f4101bea6b91e453e772854c41/68747470733a2f2f706f7365722e707567782e6f72672f6768616e656d2f676f6f676c652d6d61702f646f776e6c6f6164732e737667)](https://packagist.org/packages/ghanem/google-map)

Nova Google Map with Autocomplete
=================================

[](#nova-google-map-with-autocomplete)

A Laravel Nova field that provides an interactive Google Map with Places Autocomplete for picking locations. Users can search for addresses, drag a marker, or enter coordinates manually.

[![Screenshot](docs/screenshot-fields.png)](docs/screenshot-fields.png)

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel Nova 4.x or 5.x
- A Google Cloud API key with **Maps JavaScript API** and **Places API** enabled

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

[](#installation)

```
composer require ghanem/google-map
```

Publish the config file:

```
php artisan vendor:publish --provider="Ghanem\GoogleMap\FieldServiceProvider"
```

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

[](#configuration)

Add your Google Maps API key to `.env`:

```
GMAPS_API_KEY=your-api-key-here
```

Optional environment variables with their defaults:

```
GMAPS_DEFAULT_LATITUDE=41.657523
GMAPS_DEFAULT_LONGITUDE=-101.157292
GMAPS_DEFAULT_ZOOM=3
```

> Get your API key from the [Google Cloud Console](https://console.cloud.google.com/apis/credentials). Make sure to enable both **Maps JavaScript API** and **Places API**.

Usage
-----

[](#usage)

Add the field to your Nova resource:

```
use Ghanem\GoogleMap\GHMap;

public function fields(NovaRequest $request): array
{
    return [
        // ...
        GHMap::make('Location'),
    ];
}
```

Your model needs `latitude` and `longitude` columns (or custom names — see below).

### Custom Field Names

[](#custom-field-names)

If your database columns are not named `latitude` and `longitude`:

```
GHMap::make('Location')
    ->latitude('lat')
    ->longitude('lng'),
```

### Hide Coordinate Inputs

[](#hide-coordinate-inputs)

```
GHMap::make('Location')
    ->hideLatitude()
    ->hideLongitude(),
```

### Custom Zoom Level

[](#custom-zoom-level)

```
GHMap::make('Location')
    ->zoom(10),
```

### Override API Key Per Field

[](#override-api-key-per-field)

```
GHMap::make('Location')
    ->apiKey('different-api-key'),
```

### All Options Combined

[](#all-options-combined)

```
GHMap::make('Location')
    ->latitude('lat')
    ->longitude('lng')
    ->zoom(12)
    ->hideLatitude()
    ->hideLongitude(),
```

You can also use any standard Nova field methods (validation, visibility, etc.):

```
GHMap::make('Location')
    ->rules('required')
    ->hideFromIndex(),
```

Events
------

[](#events)

When a location is selected (via autocomplete or marker drag), the field emits Nova events that you can listen to in other custom fields:

EventDescription`address-update`Full formatted address`city-update`City / locality name`state-update`State / administrative area`country-update`Country name`zip-code-update`Postal code`latitude-update`Latitude value (incoming)`longitude-update`Longitude value (incoming)Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for release history.

License
-------

[](#license)

MIT - see [LICENSE](LICENSE) for details.

Sponsor
-------

[](#sponsor)

[Become a Sponsor](https://github.com/sponsors/AbdullahGhanem)

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance86

Actively maintained with recent releases

Popularity36

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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

Total

5

Last Release

71d ago

Major Versions

v1.0.1 → v2.02025-01-26

v2.1 → V3.02026-03-08

PHP version history (2 changes)v1.0PHP ^7.4|^8.0

V3.0PHP ^8.1

### Community

Maintainers

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

---

Top Contributors

[![AbdullahGhanem](https://avatars.githubusercontent.com/u/5055892?v=4)](https://github.com/AbdullahGhanem "AbdullahGhanem (14 commits)")

---

Tags

google-mapslaravellaravel-nova-fieldlaravelnovalaravelautocompletegeocodinggoogle mapnovagoogle placesnova-4nova-5

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ghanem-google-map/health.svg)

```
[![Health](https://phpackages.com/badges/ghanem-google-map/health.svg)](https://phpackages.com/packages/ghanem-google-map)
```

###  Alternatives

[optimistdigital/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2872.1M6](/packages/optimistdigital-nova-sortable)[outl1ne/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2861.8M9](/packages/outl1ne-nova-sortable)[vyuldashev/nova-money-field

A Laravel Nova field for Money.

73784.4k1](/packages/vyuldashev-nova-money-field)[alexwenzel/nova-dependency-container

A Laravel Nova 4 form container for grouping fields that depend on other field values.

461.0M2](/packages/alexwenzel-nova-dependency-container)[norman-huth/nova-assets-changer

Change Nova resources

2570.1k](/packages/norman-huth-nova-assets-changer)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57215.9k](/packages/sbine-route-viewer)

PHPackages © 2026

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