Skip to content

Commit 6741015

Browse files
authored
Merge pull request #614 from Laravel-Backpack/update-google-docs
add note about key requirements
2 parents 8ed8018 + a845b7e commit 6741015

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

6.x/crud-fields.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,13 @@ CRUD::field([ // Address google
11381138

11391139
Using Google Places API is dependent on using an API Key. Please [get an API key](https://console.cloud.google.com/apis/credentials) - you do have to configure billing, but you qualify for $200/mo free usage, which covers most use cases. Then copy-paste that key as your ```services.google_places.key``` value.
11401140

1141+
**IMPORTANT NOTE**: Your key needs access to the following APIS:
1142+
- Maps JavaScript API;
1143+
- Places API;
1144+
- Geocoding API.
1145+
1146+
While developing you can use an "unrestricted key" (no restrictions for where the key is used), but for production you should use a separate key, and **MAKE SURE** you restrict the usage of that key to your own domain.
1147+
11411148
So inside your ```config/services.php``` please add the items below:
11421149
```php
11431150
'google_places' => [
@@ -1558,6 +1565,13 @@ Using Google Places API is dependent on using an API Key. Please [get an API key
15581565
],
15591566
```
15601567

1568+
**IMPORTANT NOTE**: Your key needs access to the following APIS:
1569+
- Maps JavaScript API;
1570+
- Places API;
1571+
- Geocoding API.
1572+
1573+
While developing you can use an "unrestricted key" (no restrictions for where the key is used), but for production you should use a separate key, and **MAKE SURE** you restrict the usage of that key to your own domain.
1574+
15611575
**How to save in multiple inputs?**
15621576

15631577
There are cases where you rather save the information on separate inputs in the database. In that scenario you should use [Laravel mutators and accessors](https://laravel.com/docs/10.x/eloquent-mutators). Using the same field as previously shown (**field name is `location`**), and having `latitude`, `longitude`, `full_address` as the database columns, we can save and retrieve them separately too:

7.x-dev/crud-fields.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,13 @@ CRUD::field([ // Address google
11381138

11391139
Using Google Places API is dependent on using an API Key. Please [get an API key](https://console.cloud.google.com/apis/credentials) - you do have to configure billing, but you qualify for $200/mo free usage, which covers most use cases. Then copy-paste that key as your ```services.google_places.key``` value.
11401140

1141+
**IMPORTANT NOTE**: Your key needs access to the following APIS:
1142+
- Maps JavaScript API;
1143+
- Places API;
1144+
- Geocoding API.
1145+
1146+
While developing you can use an "unrestricted key" (no restrictions for where the key is used), but for production you should use a separate key, and **MAKE SURE** you restrict the usage of that key to your own domain.
1147+
11411148
So inside your ```config/services.php``` please add the items below:
11421149
```php
11431150
'google_places' => [
@@ -1423,6 +1430,13 @@ Using Google Places API is dependent on using an API Key. Please [get an API key
14231430
],
14241431
```
14251432

1433+
**IMPORTANT NOTE**: Your key needs access to the following APIS:
1434+
- Maps JavaScript API;
1435+
- Places API;
1436+
- Geocoding API.
1437+
1438+
While developing you can use an "unrestricted key" (no restrictions for where the key is used), but for production you should use a separate key, and **MAKE SURE** you restrict the usage of that key to your own domain.
1439+
14261440
**How to save in multiple inputs?**
14271441

14281442
There are cases where you rather save the information on separate inputs in the database. In that scenario you should use [Laravel mutators and accessors](https://laravel.com/docs/10.x/eloquent-mutators). Using the same field as previously shown (**field name is `location`**), and having `latitude`, `longitude`, `full_address` as the database columns, we can save and retrieve them separately too:

0 commit comments

Comments
 (0)