mattrothenberg/location

There is no license information available for the latest version (1.0) of this package.

Installs: 1 532

Dependents: 0

Suggesters: 0

Security: 0

Stars: 5

Watchers: 1

Forks: 1

Open Issues: 21

Language:Vue

Type:statamic-addon


README

A Location Autocomplete Field for Statamic V3

68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f70726163746963616c6465762f696d6167652f66657463682f732d2d7044775058736f4e2d2d2f635f696d616767615f7363616c652c665f6175746f2c666c5f70726f67726573736976652c685f3432302c715f6175746f2c775f313030302f68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f70726163746963616c6465762f696d6167652f66657463682f732d2d5f3747466d6f4d2d2d2d2f635f696d616767615f7363616c65253243665f6175746f253243666c5f70726f6772657373697665253243685f343230253243715f6175746f253243775f313030302f68747470733a2f2f74686570726163746963616c6465762e73332e616d617a6f6e6177732e636f6d2f692f6a32776a65337775636c677473726a67363766382e706e67

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

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 under the hood for location autocompletion.

PLACES_APP_ID=""
PLACES_API_KEY=""