Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
naifalshaye authored Jan 8, 2019
1 parent fa79c4b commit 183ef0a
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,26 @@ You can install the package in to a Laravel app that uses Nova via composer:
```bash
composer require naif/address_autocomplete
```
## Configuration
Publish the package config file:
```bash
php artisan vendor:publish --provider="Naif\AddressAutocomplete\FieldServiceProvider"
```

Configuration will be published at [config/address_autocomplete.php].


Add the following keys to your `.env` and `.env.example`:

```
ADDRESS_AUTOCOMPLETE_API_KEY=
Optional: Set map and address language
ADDRESS_AUTOCOMPLETE_LANGUAGE=fr
```

_If you need a Google Maps API key, you can create an app and enable Places API and create credentials to get your API key https://console.developers.google.com._


## Usage:
Add the below to Nova/User.php resource:
Expand All @@ -28,26 +48,6 @@ 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=############################

```

![Package screenshot](https://pbs.twimg.com/media/DlnCDrbX0AAi1fw.jpg)

## Support:
Expand Down

0 comments on commit 183ef0a

Please sign in to comment.