alexandreo/data-bindr
Api Integraton for https://www.databindr.com/#!/docs
3,156
4
| Install | |
|---|---|
composer require alexandreo/data-bindr |
|
| Latest Version: | 1.1 |
| PHP: | >=7.0 |
| Laravel: | 5 |
| License: | MIT |
| Last Updated: | Oct 26, 2017 |
| Links: | GitHub · Packagist |
Maintainer: alexandreo
Data Bindr Client
Project for integration with databindr (Hotel Mapping).
Install
Composer
"alexandreo/data-bindr": "^1.0"
##Integration documentation with the Databindr https://www.databindr.com/#!/docs
How to use
use Alexandreo\DataBindr\HotelBindr;
$hotelBindr = new HotelBindr(['key' => 'PLACE YOUR SECURITY KEY HERE']);
$requests = [
[
'country_id' => 'USA',// u can send Alpha2, Alpha3 or Country Name.
'name' => 'RAMADA HIALEAH/MIAMI AIRPORT NORTH',
'address' => '1950 W 49TH STREET, HIALEAH, FLÓRIDA, ESTADOS UNIDOS DA AMÉRICA',
'category' => '***',
'town' => 'Miami',
'zip' => '33012'
],
[
'country_id' => 'USA',// u can send Alpha2, Alpha3 or Country Name.
'name' => 'RAMADA HIALEAH/MIAMI AIRPORT NORTH',
'address' => '1950 W 49TH STREET, HIALEAH, FLÓRIDA, ESTADOS UNIDOS DA AMÉRICA',
'category' => '***',
'town' => 'Miami',
'zip' => '33012'
],
[
'country_id' => 'USA',// u can send Alpha2, Alpha3 or Country Name.
'name' => 'RAMADA HIALEAH/MIAMI AIRPORT NORTH',
'address' => '1950 W 49TH STREET, HIALEAH, FLÓRIDA, ESTADOS UNIDOS DA AMÉRICA',
'category' => '***',
'town' => 'Miami',
'zip' => '33012'
]
];
$hotelBindrRequests = $hotelBindr->hotelbindr($requests);
$hotelBindrRequests->each(function($hotelBindrRequest) {
if ($hotelBindrRequest->isError()) {
//show error
echo $hotelBindrRequest->getErrorReason();
} else {
//prints BIND ID
echo $hotelBindrRequest->getBindId();
echo $hotelBindrRequest;
//show request
echo $hotelBindrRequest->getHotelBindrRequest()->getName();
}
});
//or u can use foreach
foreach ($hotelBindrRequests as $hotelBindrRequest){
if ($hotelBindrRequest->isError()) {
//show error
echo $hotelBindrRequest->getErrorReason();
} else {
//prints BIND ID
echo $hotelBindrRequest->getBindId();
echo $hotelBindrRequest;
//show request
echo $hotelBindrRequest->getHotelBindrRequest()->getName();
}
}
##Exemples https://github.com/alexandreo/DataBindrClient/blob/master/exemples/
Related Packages
doctrine/dbal
Powerful PHP database abstraction layer (DBAL) with many features for database s...
641,106,524
9,700
laravel/serializable-closure
Laravel Serializable Closure provides an easy and secure way to serialize closur...
418,291,778
609
nunomaduro/collision
Cli error handling for console/command-line PHP applications.
394,964,158
4,660
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 1.1 | >=7.0 | 5.* | MIT | |
| 1.0 | >=7.0 | 5.* | MIT |