PHP code example of litstack / location

1. Go to this page and download the library: Download litstack/location library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

litstack / location example snippets


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

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

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

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