Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/FieldServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ class FieldServiceProvider extends ServiceProvider
*/
public function boot()
{
// $this->publishes([
// $this->configPath() => config_path('nova-address-field.php'),
// ], 'nova-address-field-config');
/**
* Required this script to publish the nova-address-field.php file
* so user can set the key from nova-address-field.php,
* Sometimes cache create issue to get the key from env('GOOGLE_PLACES_API_KEY').
*/
$this->publishes([
$this->configPath() => config_path('nova-address-field.php'),
], 'nova-address-field-config');

Nova::serving(function (ServingNova $event) {
// $key = Config::get('nova-address-field.api_key');
$key = env('GOOGLE_PLACES_API_KEY');
$key = Config::get('nova-address-field.api_key');
// $key = env('GOOGLE_PLACES_API_KEY');
Nova::script('google-maps', "https://maps.googleapis.com/maps/api/js?key={$key}&libraries=places");
Nova::script('address-field', __DIR__.'/../dist/js/field.js');
Nova::style('address-field', __DIR__.'/../dist/css/field.css');
Expand Down