2017 © Pedro Peláez
 

library order-by-distance

A Laravel package that manages `ORDER BY` clause sorting by distance.

image

sukohi/order-by-distance

A Laravel package that manages `ORDER BY` clause sorting by distance.

  • Tuesday, October 31, 2017
  • by Sukohi
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

OrderByDistance

A Laravel package that manages ORDER BY clause sorting by distance.
(This package is maintained under L5.5.), (*1)

Installation

Execute the following composer command., (*2)

composer require sukohi/order-by-distance:1.*

Preparation

This package is Trait. So please add OrderByDistanceTrait to your model like so., (*3)

<?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., (*4)

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., (*5)

Copyright 2017 Sukohi Kuhoh, (*6)

The Versions

31/10 2017

1.0.x-dev

1.0.9999999.9999999-dev

A Laravel package that manages `ORDER BY` clause sorting by distance.

  Sources   Download

MIT

The Requires

 

by Avatar Sukohi

31/10 2017

dev-master

9999999-dev

A Laravel package that manages `ORDER BY` clause sorting by distance.

  Sources   Download

MIT

The Requires

 

by Avatar Sukohi

31/10 2017

1.0.1

1.0.1.0

A Laravel package that manages `ORDER BY` clause sorting by distance.

  Sources   Download

MIT

The Requires

 

by Avatar Sukohi

31/10 2017

1.0.0

1.0.0.0

A Laravel package that manages `ORDER BY` clause sorting by distance.

  Sources   Download

The Requires

 

by Avatar Sukohi