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

Commit

Permalink
Changed env call in favor of config call to obtain api key
Browse files Browse the repository at this point in the history
  • Loading branch information
emilianotisato committed Oct 19, 2018
1 parent 55c466d commit 71f4c72
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Add the below to /resources/views/vendor/nova/layout.blade.php (this you can cop
* To get results in specific language add `&language=en` to the below script url

```php
<script src="https://maps.googleapis.com/maps/api/js?key={{env('ADDRESS_AUTOCOMPLETE_API_KEY')}}&libraries=places"></script>
<script src="https://maps.googleapis.com/maps/api/js?key={{config('google-autocomplete.api_key')}}&libraries=places"></script>
```

Add the below to your `.env` file
Expand Down
7 changes: 7 additions & 0 deletions config/google-autocomplete.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return [
// Get your key from https://console.developers.google.com

'api_key' => env('ADDRESS_AUTOCOMPLETE_API_KEY', '')
];
4 changes: 4 additions & 0 deletions src/FieldServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ public function boot()
$this->publishes([
__DIR__.'/../resources/lang' => resource_path('lang/vendor/google-autocomplete'),
], 'google-autocomplete-lang');

$this->publishes([
__DIR__.'/../config' => config_path(),
], 'google-autocomplete-config');
}


Expand Down

0 comments on commit 71f4c72

Please sign in to comment.