Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abr4xas/gmaps-input-backpack
Custom Google Maps Input for Laravel Backpack
https://github.com/abr4xas/gmaps-input-backpack
google google-maps laravel-backpack maps
Last synced: about 2 months ago
JSON representation
Custom Google Maps Input for Laravel Backpack
- Host: GitHub
- URL: https://github.com/abr4xas/gmaps-input-backpack
- Owner: abr4xas
- Created: 2020-01-13T13:16:41.000Z (almost 5 years ago)
- Default Branch: dev
- Last Pushed: 2023-01-29T21:19:57.000Z (almost 2 years ago)
- Last Synced: 2024-10-11T11:30:18.829Z (3 months ago)
- Topics: google, google-maps, laravel-backpack, maps
- Language: Blade
- Homepage: https://packagist.org/packages/abr4xas/gmaps-input-backpack
- Size: 219 KB
- Stars: 2
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
#### Custom Google Maps Input for Laravel Backpack
#### How to install
with composer:
```bash
composer require abr4xas/gmaps-input-backpack
```#### How to use
Add your Google Api Key to the env file:
```
GOOGLE_MAPS_API_KEY=
```Add this to your backpack controller:
```php
$this->crud->addField([
'name' => 'address-input', // do not change this
'type' => 'customGoogleMaps', // do not change this
'label' => "Google Maps",
'hint' => 'Help text',
'attributes' => [
'class' => 'form-control map-input', // do not change this, add more classes if needed
],
'view_namespace' => 'custom-google-maps-field-for-backpack::fields',
]);
```
> Notice the view_namespace attribute - make sure that is exactly as above, to tell Backpack to load the field from this addon package, instead of assuming it's inside the Backpack\CRUD package.#### Preview:
![Custom Google Maps Input for Laravel Backpack](custom-google-map-input-backpack-field.png "Custom Google Maps Input for Laravel Backpack")
Thanks to https://laraveldaily.com/laravel-find-addresses-with-coordinates-via-google-maps-api/ for the inspiration.