digitalcloud/nova-address-field
最新稳定版本:v1.3
Composer 安装命令:
composer require digitalcloud/nova-address-field
包简介
A Laravel Nova Address field.
README 文档
README
This field allows you to pick address using Google Places API by three ways:
- using autocomplete input: user can start typing and the address will autocompleted. after the user select a place from the popup places the full real address with all the metadata (like latitude and longitude) will be filled in the form and the map will centered to the selected address.
- using lat and long input: if you have the specific lat and lng for the place, you can put the in the form and the autocomplete input will be refreshed with the formatted address for this lat and lng, the map also will be centered to the ne address.
- using map: you can pick the address by click on the place on the map and the real address will be filled automatically.
Installation
You can install the package via composer:
composer require digitalcloud/nova-address-field
You need to provide the Google places API key, you can get one from https://console.developers.google.com
and then add the api key to your .env file
GOOGLE_PLACES_API_KEY=############################
Usage
use DigitalCloud\AddressField\AddressField; // .... AddressField::make('Address'), //You can enable lat and lng inputs: GoogleAutocomplete::make('Address') ->withLatLng(), //You can enable map picking address: GoogleAutocomplete::make('Address') ->withMap(), //You can set the init location and zoom for the map: GoogleAutocomplete::make('Address') ->withMap()->initLocation('24.6', '46.7')->zoom(5),
Images
统计信息
- 总下载量: 18.6k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-12-11