PHP code example of akuechler / laravel-geoly

1. Go to this page and download the library: Download akuechler/laravel-geoly 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/ */

    

akuechler / laravel-geoly example snippets


$table->double('latitude');
$table->double('longitude');

const LATITUDE  = 'lat';
const LONGITUDE = 'lng';

class YourModel extends Model
{
    use Geoly;
    ...
}

$query = YourModel::radius($latitude, $longitude, $radius);
$query->get();