承接 akuechler/laravel-geoly 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

akuechler/laravel-geoly

最新稳定版本:v1.0.6

Composer 安装命令:

composer require akuechler/laravel-geoly

包简介

Perform fast and efficient radius searches on your Laravel Eloquent models.

README 文档

README

Packagist Version PHP from Packagist StyleCI GitHub

Perform fast and efficient radius searches on your Laravel Eloquent models.

Laravel Geoly provides a convenient way for your Laravel Eloquent models to query in a certain radius around a position. It is lightning fast by using a bounding box to cut down the possible results and calculating the distance only on the remaining subset. Laravel Geoly works on both MySQL and PostgreSQL.

Requirements

  • PHP 7.1+
  • Laravel 5+
  • Tested on MySQL and PostgreSQL

Installation

Simply require the project via composer:

$ composer require akuechler/laravel-geoly

How to use

Geoly assumes the two columns latitude and longitude on your eloquent model. Simply add them to your migration if not present yet.

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

If you prefer to use other names for your database columns, specify them in your model.

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

Use the Geoly package within your Eloquent model.

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

To search for all models within a specific radius around a position, add the radius scope to your query.

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

Credits

This project is heavily inspired by Laravel Geographical and Movable Type Scripts article on Selecting points within a bounding circle.

统计信息

  • 总下载量: 55.37k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 42
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 42
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固