承接 ehsan_coder/neshan-laravel 相关项目开发

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

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

ehsan_coder/neshan-laravel

最新稳定版本:v1.1.2

Composer 安装命令:

composer require ehsan_coder/neshan-laravel

包简介

Easy-to-use SDK for implementing Neshan RestFull web APIs in your Laravel projects.

README 文档

README


Logo

Neshan Laravel SDK

Easy-to-use SDK for implementing Neshan APIs in your Laravel projects.


Install

The easiest way to install is by using Composer:

composer require ehsan_coder/neshan-laravel

Composer is a dependency manager for PHP which allows you to declare the libraries your project depends on, and it will manage (install/update) them for you. If you are not familiar with Composer, you can read its documentations and download it via getcomposer.org.

configuration .env file

add account information into .env file

NESHAN_API_KEY=your neshan api key

usage

To use the package, you need an API key. To get that you should have a Neshan account. Register and get your API key.
Use NeshanFacade on top of your controller or wherever you want:

use EhsanCoder\NeshanLaravel\NeshanFacade;

all APIs of Neshan exist in this Facade! for example to use distanceMatrix API we can use:

$response = EhsanCoder\NeshanLaravel\NeshanFacade::distanceMatrix($origins, $destinations, $type, $timeout = 10);

for Example

$response = EhsanCoder\NeshanLaravel\NeshanFacade::distanceMatrix('36.279589071020425,50.00901454609652','38.279589071020425,51.00901454609652', EhsanCoder\NeshanLaravel\NeshanAPI::DISTANCE_MATRIX_CAR_TYPE);

Parameters

Parameter Required Description Type Example
$origins Yes all origins! every origin must separated by pipe character string 36.279589071020425,50.00901454609652
$destinations Yes same of origins parameter string 38.279589071020425,51.00901454609652
$type No default value is car string car
$timeout No default value of timeout is 5 sec int 10

统计信息

  • 总下载量: 974
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-25