Skip to content

Nova address field that autocomplete the user input to show suggested addresses using Google Place service.

Notifications You must be signed in to change notification settings

devmtm/nova-address-autocomplete

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nova Address AutoComplete Field

An address field that autocomplete the user input to show suggested addresses using Google Place service.

Installation

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

composer require naif/address_autocomplete

Usage:

Add the below to Nova/User.php resource:

AddressAutocomplete::make('Address'),

//You can add a country or countries to autocomplete or leave empty for all.
          
// Specify a single country
AddressAutocomplete::make('Address')
          ->countries('US'),
                
// Specify multiple countries [array]
AddressAutocomplete::make('Address')
          ->countries(['US','AU]),

Add the below to nova/resources/views/layout.blade.php

  • To get resualts in specific language add (&language=en) to the below
<script src="https://maps.googleapis.com/maps/api/js?key={{env('ADDRESS_AUTOCOMPLETE_API_KEY')}}&libraries=places"></script>
             

Add the below to your .env file

Create an app and enable Places API and create credentials to get your API key https://console.developers.google.com

ADDRESS_AUTOCOMPLETE_API_KEY=############################

Package screenshot

License

The MIT License (MIT). Please see License File for more information.

About

Nova address field that autocomplete the user input to show suggested addresses using Google Place service.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Vue 56.8%
  • PHP 29.0%
  • JavaScript 13.7%
  • CSS 0.5%