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

Commit

Permalink
use remove script
Browse files Browse the repository at this point in the history
  • Loading branch information
swilla committed Jan 22, 2021
1 parent 15e0b7c commit 62161a1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/FieldServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ public function boot()
], 'google-autocomplete-config');
}


$this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'google-autocomplete');
$this->loadJsonTranslationsFrom(resource_path('lang/vendor/google-autocomplete'));

Nova::serving(function (ServingNova $event) {
Nova::script('google-autocomplete', __DIR__.'/../dist/js/field.js');
Nova::style('google-autocomplete', __DIR__.'/../dist/css/field.css');
Nova::remoteScript('https://maps.googleapis.com/maps/api/js?key='.config('google-autocomplete.api_key').'&libraries=places');
Nova::provideToScript([
'google_autocomplete_translations' => $this->getTranslations(),
]);
Expand Down Expand Up @@ -60,7 +61,7 @@ private static function getTranslations()
if (! is_readable($translationFile)) {
return [];
}

return json_decode(file_get_contents($translationFile), true);
}
}

0 comments on commit 62161a1

Please sign in to comment.