一个简单的包,用于根据经纬度搜索酒店

dev-main 2022-10-01 14:56 UTC

This package is auto-updated.

Last update: 2024-09-29 05:57:13 UTC


README

本包是为XLR8和PHP 8以及Laravel制作的。

特性

  • 通过参数搜索经纬度
  • 按价格排序,按夜晚和邻近度排序

安装

composer require raphaborralho/search
php artisan vendor:publish

用法

编辑并在数组中添加多个数据源

#config/search.php

return [
    //Array with multiples source
    'source' => [
        //'https://xlr8-interview-files.s3.eu-west-2.amazonaws.com/source_1.json',
        //'https://xlr8-interview-files.s3.eu-west-2.amazonaws.com/source_2.json',
    ]
];

在控制器中

use Raphaborralho\Search\Search;

在函数中

Search::getNearbyHotels($latitude, $longitude, $orderby)

许可协议

MIT