Download the PHP package sukohi/order-by-distance without Composer
On this page you can find all versions of the php package sukohi/order-by-distance. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download sukohi/order-by-distance
More information about sukohi/order-by-distance
Files in sukohi/order-by-distance
Download sukohi/order-by-distance
More information about sukohi/order-by-distance
Files in sukohi/order-by-distance
Vendor sukohi
Package order-by-distance
Short Description A Laravel package that manages `ORDER BY` clause sorting by distance.
License MIT
Package order-by-distance
Short Description A Laravel package that manages `ORDER BY` clause sorting by distance.
License MIT
Please rate this library. Is it a good library?
Informations about the package order-by-distance
OrderByDistance
A Laravel package that manages ORDER BY
clause sorting by distance.
(This package is maintained under L5.5.)
Installation
Execute the following composer command.
composer require sukohi/order-by-distance:1.*
Preparation
This package is Trait
.
So please add OrderByDistanceTrait
to your model like so.
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Sukohi\OrderByDistance\OrderByDistanceTrait;
class Landmark extends Model
{
use OrderByDistanceTrait;
}
Now you can use orderByDistance()
through the Trait.
Usage
$columns = ['latitude', 'longitude'];
$point = [35.681167, 139.767052];
$direction = 'desc'; // Default is 'asc'.
$landmarks = \App\Landmark::orderByDistance($columns, $point, $direction)->get();
License
This package is licensed under the MIT License.
Copyright 2017 Sukohi Kuhoh
All versions of order-by-distance with dependencies
PHP Build Version
Package Version
Requires
laravel/framework Version
~5.0
The package sukohi/order-by-distance contains the following files
Loading the files please wait ....