PHP code example of vedatunlu / order-by-distance

1. Go to this page and download the library: Download vedatunlu/order-by-distance 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/ */

    

vedatunlu / order-by-distance example snippets


    Location::nearestTo(41.02488721726937, 29.015275681371868)
        ->get();
        
    Location::where('title', $title)
        ->nearestTo(41.02488721726937, 29.015275681371868)
        ->get();