LaravelPackages.net
Acme Inc.
Toggle sidebar
evilfreelancer/bookeo-api-php

Bookeo API PHP7 client

9.268
3
1.2.5
About evilfreelancer/bookeo-api-php

evilfreelancer/bookeo-api-php is a Laravel package for bookeo api php7 client. It currently has 3 GitHub stars and 9.268 downloads on Packagist (latest version 1.2.5). Install it with composer require evilfreelancer/bookeo-api-php. Discover more Laravel packages by evilfreelancer or browse all Laravel packages to compare alternatives.

Last updated

Latest Stable Version Build Status Total Downloads License Code Climate Code Coverage Scrutinizer CQ

Bookeo API PHP7 client

composer require evilfreelancer/bookeo-api-php

Laravel framework support

Bookeo API client is optimized for usage as normal Laravel package, all functional is available via \BookeoApi facade, for access to client object you need instead:

$config = new \Bookeo\Config([
    'api_key'    => 'my-api-key',
    'secret_key' => 'my-secret-key'
]);
$bookeo = new \Bookeo\Client($config);

Use:

$bookeo = \BookeoApi::getClient();

You also may provide additional parameters to your client by passing array of parameters to getClient method:

$bookeo = \BookeoApi::getClient([
    'api_key'    => 'my-api-key',
    'secret_key' => 'my-secret-key'
]);

Laravel installation

Install the package via Composer:

composer require evilfreelancer/bookeo-api-php

By default the package will automatically register its service provider, but if you are a happy owner of Laravel version less than 5.3, then in a project, which is using your package (after composer require is done, of course), add intoproviders block of your config/app.php:

'providers' => [
    // ...
    Bookeo\Laravel\ClientServiceProvider::class,
],

Optionally, publish the configuration file if you want to change any defaults:

php artisan vendor:publish --provider="Bookeo\\Laravel\\ClientServiceProvider"

How to use

require_once __DIR__ . '/../vendor/autoload.php';

use \Bookeo\Client;
use \Bookeo\Models\MatchingSlotsSearchParameters;

$bookeo = new Client([
    'secret_key' => 'xxxxxxx',
    'api_key'    => 'xxxxxxxxxxxxxxxx'
]);

$result = $bookeo->availability->slots(null, '2019-09-16T00:00:00Z', '2019-09-18T23:59:59Z')->exec();
print_r($result);

$search = new MatchingSlotsSearchParameters();
$search->productId = 'unique-id-of-product';

$result = (string) $bookeo->availability->matching_slots->search($search)->exec();
print_r($result);

$result = (string) $bookeo->availability->matching_slots('pageNavigationToken', 1)->exec();
print_r($result);

Links

  • https://www.bookeo.com/apiref/index.html
  • https://www.bookeo.com/api/

Star History Chart