litstack/location

Maintainers

Package info

github.com/litstack/location

Language:Vue

pkg:composer/litstack/location

Transparency log

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2021-07-14 12:32 UTC

This package is auto-updated.

Last update: 2026-07-13 10:07:50 UTC


README

A field that stores the latand lng values as well as further information of a place you can search like on google maps.

Setup

Prepare your model with two float colums, e.g. lat and lng and set them fillable.

$table->float('lat', 12, 9);
$table->float('lng', 12, 9);

In order to use the location field you need an Google-API-Key with the following APIs activated:

  • Maps JavaScript
  • Places API

Add this to your lit config.

'location' => [
    'google_api_key' => env('GOOGLE_API_KEY'),
],

Now the map field can be used like this:

$form->map('lat', 'lng');

You can save further information from the Places-API like this:

$form->map('lat', 'lng', [
    'formatted_address' => 'address', // saves the formatted_address attribute in the address column of your model
]);