Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattrothenberg/location
A Location Autocomplete Field for Statamic V3
https://github.com/mattrothenberg/location
algolia algolia-places statamic statamic-v3 vue
Last synced: about 1 month ago
JSON representation
A Location Autocomplete Field for Statamic V3
- Host: GitHub
- URL: https://github.com/mattrothenberg/location
- Owner: mattrothenberg
- Created: 2019-12-05T20:22:51.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T02:24:19.000Z (almost 2 years ago)
- Last Synced: 2024-09-06T04:45:16.777Z (4 months ago)
- Topics: algolia, algolia-places, statamic, statamic-v3, vue
- Language: Vue
- Size: 2.47 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mattrothenberg\Location
A Location Autocomplete Field for Statamic V3## Why?
The inspiration for publishing this addon came from writing the following blog post.[https://dev.to/mattrothenberg/build-a-location-autocomplete-field-for-statamic-v3-49cp](https://dev.to/mattrothenberg/build-a-location-autocomplete-field-for-statamic-v3-49cp)
Co-locating a custom fieldtype within your Statamic app is one thing... Building an addon so that other folks can use it, too, is another. This is the fruit of my labor!
## Installation
(shamelessly cribbed from https://github.com/riasvdv/statamic-color-swatches)
Clone the Github repo somewhere, then add it to your composer.json's repositories array. (This is only necessary until the package is released.) Adjust the url to point to cloned directory.
```
"repositories": [
{
"type": "path",
"url": "addons/mattrothenberg/location"
}
]
```Require it using Composer.
```
composer require mattrothenberg/location
```Publish the assets
```
php artisan vendor:publish --provider="Mattrothenberg\Location\ServiceProvider"
```Add two environment variables, since this library uses [Places.js](https://github.com/algolia/places) under the hood for location autocompletion.
```
PLACES_APP_ID=""
PLACES_API_KEY=""
```