PHPackages                             brandonjbegle/nova4-google-autocomplete-field - 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. brandonjbegle/nova4-google-autocomplete-field

ActiveLibrary[API Development](/categories/api)

brandonjbegle/nova4-google-autocomplete-field
=============================================

This Nova Package it's a Field that allows you to Autocomplete addresses with Google Place API and get the full metadata (lat and long, etc).

v0.2.9(5mo ago)334.5k↑54.3%4MITVuePHP ^8.0

Since May 9Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/brandonjbegle/nova4-google-autocomplete-field)[ Packagist](https://packagist.org/packages/brandonjbegle/nova4-google-autocomplete-field)[ RSS](/packages/brandonjbegle-nova4-google-autocomplete-field/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (15)Used By (0)

Nova Google AutoComplete Field Package
======================================

[](#nova-google-autocomplete-field-package)

This field allows you to work with Google Places API to autocomplete on user input and get the full real address with all the metadata (like latitude and longitude).

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

[](#installation)

You can install the package in to a Laravel app that uses Nova via composer:

```
composer require brandonjbegle/nova4-google-autocomplete-field
```

Now publish config and localization files:

```
php artisan vendor:publish --provider="BrandonJBegle\GoogleAutocomplete\FieldServiceProvider"
```

Create an app and enable Places API and create credentials to get your API key

Add the below to your `.env` file

```
ADDRESS_AUTOCOMPLETE_API_KEY=############################
```

Usage
-----

[](#usage)

Add the use declaration to your resource and use the fields:

```
use BrandonJBegle\GoogleAutocomplete\GoogleAutocomplete;
// ....

GoogleAutocomplete::make('Address'),

//You can add a country or countries to autocomplete or leave empty for all.

// Specify a single country
GoogleAutocomplete::make('Address')
          ->countries('US'),

// Specify multiple countries [array]
GoogleAutocomplete::make('Address')
          ->countries(['US','AU]),
```

You can access other parameter like `latitude, longitude, street_number, route, locality, administrative_area_level_1, country, postal_code`, along with everything available in the - every field present in the [PlaceResult object](https://developers.google.com/maps/documentation/javascript/reference/#PlaceResult)

```
use BrandonJBegle\GoogleAutocomplete\AddressMetadata;
use BrandonJBegle\GoogleAutocomplete\GoogleAutocomplete;

// Now this address field will search and store the address as a string, but also made available the values in the withValues array
GoogleAutocomplete::make('Address')->withValues(['latitude', 'longitude']),

// And you can store the values by autocomplete like this
AddressMetadata::make('lat')->fromValue('latitude'),
AddressMetadata::make('long')->fromValue('longitude'),

// You can disable the field so the user can't edit the metadata
AddressMetadata::make('long')->fromValue('longitude')->disabled(),

// Or you can make the field invisible in the form but collect the data anyways
AddressMetadata::make('long')->fromValue('longitude')->invisible(),
```

### Combine Values

[](#combine-values)

If you want to concatenate certain elements of the geocoded object that is returned by Google, using `{{` and `}}`, wrap the key like you would above; like so:

```
use BrandonJBegle\GoogleAutocomplete\AddressMetadata;
use BrandonJBegle\GoogleAutocomplete\GoogleAutocomplete;

GoogleAutocomplete::make('Address')->withValues(['latitude', 'longitude']),

AddressMetadata::make('coordinates')->fromValue('{{latitude}}, {{longitude}}'),
```

So the value that would be rendered within the coordinates input would be something like:

```
39.3315476, -94.9363912

```

### Define Short/Long Value

[](#define-shortlong-value)

If you would like to use the **long\_name** version of the geocoded object (Kansas versus KS), you can define the `GoogleAutocomplete` field values with dot notation followed with the name version you want to use; like so:

```
use BrandonJBegle\GoogleAutocomplete\GoogleAutocomplete;

GoogleAutocomplete::make('Address')
    ->withValues([
        'route.short_name',
        'administrative_area_level_1.long_name',
    ]),
```

Which would return:

**route:** W 143rd St

**administrative\_area\_level\_1:** Kansas

You can change the type of places that are returned by the autocomplete using the placeType() method. You can use any of the values listed at [https://developers.google.com/places/supported\_types#table3](https://developers.google.com/places/supported_types#table3)

```
use BrandonJBegle\GoogleAutocomplete\AddressMetadata;
use BrandonJBegle\GoogleAutocomplete\GoogleAutocomplete;

// This autocomplete field will return results that match a business name instead of address.
// All the same address data is still stored.
GoogleAutocomplete::make('Address')->placeType('establishment');
```

Enable Current Location Button
------------------------------

[](#enable-current-location-button)

```
GoogleAutocomplete::make('Address')->enableCurrentLocation();
```

Enable/Disable automatic loading of Google Maps Places JS.
----------------------------------------------------------

[](#enabledisable-automatic-loading-of-google-maps-places-js)

It is enabled by default. How to disable it:

```
// config/google-autocomplete.php
'load_maps_api' => false,
```

Localization
------------

[](#localization)

If you want this package in your language, just create a json lang file in your `resources/lang/vendor/google-autocomplete` folder. Example

```
resources/lang/vendor/google-autocomplete/es.json

```

[Thanks to Emiliano Tisato's original Nova Google AutoComplete Field, which is the source of this Nova 4 package](https://github.com/emilianotisato/nova-google-autocomplete-field)

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance72

Regular maintenance activity

Popularity34

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85% 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 ~119 days

Recently: every ~79 days

Total

12

Last Release

160d ago

### Community

Maintainers

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

---

Top Contributors

[![brandonjbegle](https://avatars.githubusercontent.com/u/22717872?v=4)](https://github.com/brandonjbegle "brandonjbegle (17 commits)")[![franckitho](https://avatars.githubusercontent.com/u/33814441?v=4)](https://github.com/franckitho "franckitho (1 commits)")[![jordantweyer](https://avatars.githubusercontent.com/u/22717877?v=4)](https://github.com/jordantweyer "jordantweyer (1 commits)")[![meyer59](https://avatars.githubusercontent.com/u/9505463?v=4)](https://github.com/meyer59 "meyer59 (1 commits)")

---

Tags

laravelfieldnovaGoogle Places Apiaddress autocomplete

### Embed Badge

![Health badge](/badges/brandonjbegle-nova4-google-autocomplete-field/health.svg)

```
[![Health](https://phpackages.com/badges/brandonjbegle-nova4-google-autocomplete-field/health.svg)](https://phpackages.com/packages/brandonjbegle-nova4-google-autocomplete-field)
```

###  Alternatives

[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[hammerstone/refine-nova

A Laravel Nova integration for the Refine query builder.

3356.5k](/packages/hammerstone-refine-nova)[stepanenko3/nova-json

Nova json field to spread a json column throughout multiple fields.

42249.7k](/packages/stepanenko3-nova-json)[optimistdigital/nova-notes-field

This Laravel Nova package adds a notes field to Nova's arsenal of fields.

52139.5k](/packages/optimistdigital-nova-notes-field)[digital-creative/nova-filepond

A Nova field for uploading File, Image and Video using filepond.

5568.0k1](/packages/digital-creative-nova-filepond)[outl1ne/nova-color-field

A Laravel Nova Color Picker field.

26249.4k](/packages/outl1ne-nova-color-field)

PHPackages © 2026

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