PHPackages                             evilfreelancer/resova-api-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. evilfreelancer/resova-api-php

ActiveLibrary[API Development](/categories/api)

evilfreelancer/resova-api-php
=============================

Resova API PHP7 client

1.2.5(5y ago)249111MITPHPPHP &gt;=7.1CI failing

Since Sep 17Pushed 5y ago3 watchersCompare

[ Source](https://github.com/EvilFreelancer/resova-api-php)[ Packagist](https://packagist.org/packages/evilfreelancer/resova-api-php)[ Docs](https://developers.resova.com/)[ Patreon](https://www.patreon.com/efreelancer)[ RSS](/packages/evilfreelancer-resova-api-php/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (4)Versions (12)Used By (1)

[![Latest Stable Version](https://camo.githubusercontent.com/a12125cf057c65617ee3b0620c71c9eca528bf44c055a2cbb3a60126287ac59b/68747470733a2f2f706f7365722e707567782e6f72672f6576696c667265656c616e6365722f7265736f76612d6170692d7068702f762f737461626c65)](https://packagist.org/packages/evilfreelancer/resova-api-php)[![Build Status](https://camo.githubusercontent.com/3d0df20567ea4e9fffcaa9493677ff52f985837f129d2daf06256646c89189fc/68747470733a2f2f7472617669732d63692e6f72672f4576696c467265656c616e6365722f7265736f76612d6170692d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/EvilFreelancer/resova-api-php)[![Total Downloads](https://camo.githubusercontent.com/6e6ffb23406c0b80213a6cf7b3613cb631dcf6cd8a72fb2f06659f6142a40c69/68747470733a2f2f706f7365722e707567782e6f72672f6576696c667265656c616e6365722f7265736f76612d6170692d7068702f646f776e6c6f616473)](https://packagist.org/packages/evilfreelancer/resova-api-php)[![License](https://camo.githubusercontent.com/46e38dae60ddc04afe947a0f2e5377f0e3b81187200427b4176a4976300e8c00/68747470733a2f2f706f7365722e707567782e6f72672f6576696c667265656c616e6365722f7265736f76612d6170692d7068702f6c6963656e7365)](https://packagist.org/packages/evilfreelancer/resova-api-php)[![Code Climate](https://camo.githubusercontent.com/82156b4f5c8df6da4e12c8b8fe55fd56231773a55a07c927fe92aebe2374ea67/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f4576696c467265656c616e6365722f7265736f76612d6170692d7068702f6261646765732f6770612e737667)](https://codeclimate.com/github/EvilFreelancer/resova-api-php)[![Code Coverage](https://camo.githubusercontent.com/e1cd5a071b8399566ded42a8877880078a360222304be014d37c223b187b3fd8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4576696c467265656c616e6365722f7265736f76612d6170692d7068702f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/EvilFreelancer/resova-api-php/?branch=master)[![Scrutinizer CQ](https://camo.githubusercontent.com/789c625c8da6735f41102537fb935a765252c168df4be8435213bb54195eaa75/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6576696c667265656c616e6365722f7265736f76612d6170692d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/evilfreelancer/resova-api-php/)

Resova API PHP7 client
======================

[](#resova-api-php7-client)

This project is a simple and minimalistic client for work with Resova API, based on Guzzle Http client.

```
composer require evilfreelancer/resova-api-php

```

Laravel framework support
-------------------------

[](#laravel-framework-support)

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

```
$config = new \Resova\Config(['api_key' => 'my-secret-key']);
$resova = new \Resova\Client($config);
```

Use:

```
$resova = \ResovaApi::getClient();
```

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

```
$resova = \ResovaApi::getClient([
    'api_key' => 'my-secret-key',
    'timeout' => 1000,
]);
```

### Laravel installation

[](#laravel-installation)

Install the package via Composer:

```
composer require evilfreelancer/resova-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 into`providers` block of your `config/app.php`:

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

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

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

```

Terminology
-----------

[](#terminology)

There are four key objects in Resova that every API developer should know about.

ObjectsDescriptionitemsAn activity/service is known as an Item, these are what your customers will purchase.instancesAn instance is a date and time belonging to an item. An instance is required to be included when creating a booking.bookingsA customer will make a booking for a specific Item and Instance (date/time), they're essentially purchasing something. All bookings belong to a TransactiontransactionsA Transaction is the overall purchase order. All Bookings belong to a Transaction and there can be more than one Booking per Transaction.How to use
----------

[](#how-to-use)

See other examples of usage [here](examples) separated by class names.

### Basic example

[](#basic-example)

```
