This repository was archived by the owner on Nov 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8df4987
Showing
18 changed files
with
11,955 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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=############################ | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.