Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abdullahghanem/nova-4-google-map
Laravel Nova Google Map
https://github.com/abdullahghanem/nova-4-google-map
google-maps laravel laravel-nova-field laravelnova
Last synced: 25 days ago
JSON representation
Laravel Nova Google Map
- Host: GitHub
- URL: https://github.com/abdullahghanem/nova-4-google-map
- Owner: AbdullahGhanem
- License: mit
- Created: 2022-10-06T14:39:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-13T00:18:54.000Z (about 1 year ago)
- Last Synced: 2024-11-29T02:11:32.716Z (about 1 month ago)
- Topics: google-maps, laravel, laravel-nova-field, laravelnova
- Language: Vue
- Homepage:
- Size: 1010 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Latest Stable Version](https://poser.pugx.org/ghanem/google-map/v/stable.svg)](https://packagist.org/packages/ghanem/google-map) [![License](https://poser.pugx.org/ghanem/google-map/license.svg)](https://packagist.org/packages/ghanem/google-map) [![Total Downloads](https://poser.pugx.org/ghanem/google-map/downloads.svg)](https://packagist.org/packages/ghanem/google-map)
# Nova Google Map With Autocomplete Field Package
This field allows you to work with Google Places API to autocomplete and Google Map on user input (latitude and longitude).
## Installation
You can install the package in to a Laravel app that uses Nova via composer:
```bash
composer require ghanem/google-map
```Now publish config and localization files:
```shell
php artisan vendor:publish --provider="Ghanem\GoogleMap\FieldServiceProvider"
```Create an app and enable Places API and create credentials to get your API key
[https://console.developers.google.com](https://console.developers.google.com)Add the below to your `.env` file
```shell
GMAPS_API_KEY=############################
```## Usage
Add the use declaration to your resource and use the fields:
```php
use Ghanem\GoogleMap\GHMap;GHMap::make('Map'), // Google Map with address picker
```![Image of character counter](docs/screenshot-fields.png)
### Customize Fields
Add custom latitude, longitude and zoom values for starting point
```php
GHMap::make('Map')
->latitude('latitude_field_name')
->longitude('longitude_field_name')
->zoom('zoom'),
```Hide latitude and longitude field
```php
GHMap::make('Map')
->hideLatitude()
->hideLongitude(),
```You can add any nova basic methods to fileds (Showing / Hiding, Validation ... ).
## Sponsor
[💚️ Become a Sponsor](https://github.com/sponsors/AbdullahGhanem)