PHP code example of salmanzafar / laravel-geo-fence

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

    

salmanzafar / laravel-geo-fence example snippets


php artisan geo:fence

**************************************************
* Welcome To Geo Fence Calculator                *
**************************************************

 Enter latitude 1: :
 > 38.199020

 Enter latitude 2: :
 > 37.090240

 Enter Longitude 1: :
 > -77.969658

 Enter Longitude 2: :
 > -95.712891

 Enter Unit k\M: :
 > K

Measured distance is: 1564.6 K

'aliases' => [

       'GeoFence' => \Salman\GeoFence\Facades\GeoFence::class,
];

php artisan vendor:publish --provider="Salman\GeoFence\GeoFenceServiceProvider"

use Salman\GeoFence\Service\GeoFenceCalculator;

 public function distance()
 {
        $d_calculator = new GeoFenceCalculator();

       $distance = $d_calculator->CalculateDistance('38.199020', '-77.969658', '37.090240', '-95.712891');

       return $distance;
 }

output: 1564.6