Skip to content
This repository was archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
Commit zero
Browse files Browse the repository at this point in the history
  • Loading branch information
emilianotisato committed Oct 3, 2018
0 parents commit 8df4987
Show file tree
Hide file tree
Showing 18 changed files with 11,955 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/.idea
/vendor
/node_modules
package-lock.json
composer.phar
composer.lock
phpunit.xml
.phpunit.result.cache
.DS_Store
Thumbs.db
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
## 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 latitud and longitud).

## Installation

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

```bash
composer require emilianotisato/nova-google-autocomplete
```

## Usage:
Add the use decalaration to your resource:

```php

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

```php

<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

```php

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

```
32 changes: 32 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "emiliano/nova-google-autocomplete",
"description": "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).",
"keywords": [
"laravel",
"nova",
"field",
"google places api",
"address autocomplete"
],
"license": "MIT",
"require": {
"php": ">=7.1.0"
},
"autoload": {
"psr-4": {
"Emilianotisato\\GoogleAutocompleteAddress\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"Emilianotisato\\GoogleAutocompleteAddress\\FieldServiceProvider"
]
}
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
Empty file added dist/css/field.css
Empty file.
Loading

0 comments on commit 8df4987

Please sign in to comment.