Neshan Laravel SDK
Easy-to-use SDK for implementing Neshan APIs in your Laravel projects.
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.
add account information into
NESHAN_API_KEY=your neshan api key
To use the package, you need an API key. To get that you should have a Neshan account. Register and get your API key.
NeshanFacade on top of your controller or wherever you want:
all APIs of Neshan exist in this Facade! for example to use
distanceMatrixAPI we can use:
$response = EhsanCoder\NeshanLaravel\NeshanFacade::distanceMatrix($origins, $destinations, $type, $timeout = 10);
$response = EhsanCoder\NeshanLaravel\NeshanFacade::distanceMatrix('36.279589071020425,50.00901454609652','38.279589071020425,51.00901454609652', EhsanCoder\NeshanLaravel\NeshanAPI::DISTANCE_MATRIX_CAR_TYPE);
|$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|