PHPackages                             ilgala/laravel-wubook - 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. ilgala/laravel-wubook

AbandonedArchivedLibrary[API Development](/categories/api)

ilgala/laravel-wubook
=====================

A WuBook bridge for Laravel 5.x http://wubook.net

33147[1 issues](https://github.com/ilgala/laravel-wubook/issues)PHP

Since Mar 28Pushed 9y agoCompare

[ Source](https://github.com/ilgala/laravel-wubook)[ Packagist](https://packagist.org/packages/ilgala/laravel-wubook)[ RSS](/packages/ilgala-laravel-wubook/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Laravel WuBook
==============

[](#laravel-wubook)

Laravel WuBook was created by, and is maintained by [Filippo Galante](https://github.com/ilgala), and is a [WuBook Wired API](http://tdocs.wubook.net/wired.html) bridge for [Laravel 5](http://laravel.com). Feel free to check out the [change log](CHANGELOG.md), [releases](https://github.com/ilgala/laravel-wubook/releases), [license](LICENSE), and [contribution guidelines](CONTRIBUTING.md). In order to use the API you have to request a provider key by sending an E-Mail at , in order to connect your WuBook account, and you'll be free to try all its features.

[![Latest Version on Packagist](https://camo.githubusercontent.com/f8838f9dff400cb25dad08a96b02d5c91bd2f180f43f3ce6ea3814a37ac636ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696c67616c612f6c61726176656c2d7775626f6f6b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ilgala/laravel-wubook)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![StyleCI](https://camo.githubusercontent.com/869afa2cc5c55cc842aaf3a2d4ba016c3ba2b3c8d3191151c0cbe46a51c699c1/68747470733a2f2f7374796c6563692e696f2f7265706f732f38363333393339322f736869656c643f6272616e63683d6d6173746572)](link-style)[![Build Status](https://camo.githubusercontent.com/b4d1a27ca2baeaafa90cf6ee94c72f25128609e47b16dc56601abd0d6da04c07/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f696c67616c612f6c61726176656c2d7775626f6f6b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/ilgala/laravel-wubook)[![Coverage Status](https://camo.githubusercontent.com/91bd418caa7dde43ddf9c6dfcb66cad27236df571cef638bf4f897a5ce5328a8/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f696c67616c612f6c61726176656c2d7775626f6f6b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/ilgala/laravel-wubook/code-structure)[![Quality Score](https://camo.githubusercontent.com/9a5c66171cd31b8461a189abe903f8258c088006845755911f0a6c5dcca57a7d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f696c67616c612f6c61726176656c2d7775626f6f6b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/ilgala/laravel-wubook)[![Total Downloads](https://camo.githubusercontent.com/83c8fab425c4ff5338ff944ab25ffabad95398f644d978c70d34bf2624d5eb9a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696c67616c612f6c61726176656c2d7775626f6f6b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ilgala/laravel-wubook)

Installation
------------

[](#installation)

Either [PHP](https://php.net) 5.5+ or [HHVM](http://hhvm.com) 3.6+ are required.

To get the latest version of Laravel WuBook, simply require the project using [Composer](https://getcomposer.org):

```
$ composer require ilgala/laravel-wubook
```

Instead, you may of course manually update your require block and run `composer update` if you so choose:

```
{
    "require": {
        "IlGala/laravel-wubook": "0.1.0-alpha"
    }
}
```

The package uses the [fxmlrpc client](https://github.com/lstrojny/fxmlrpc) to make a call to the Wired API service. The [standard dependencies](https://github.com/lstrojny/fxmlrpc#install-dependencies) are used to create the HTTP client and message, feel free to create a pull request in order to add new features.

Once Laravel WuBook is installed, you need to register the service provider. Open up `config/app.php` and add the following to the `providers` key.

```
'providers' => [
   // OTHER PROVIDERS
   'IlGala\LaravelWubook\WuBookServiceProvider::class'
],
```

You can register the WuBook facade in the `aliases` key of your `config/app.php` file if you like.

```
'aliases' => [
   // OTHER ALIASES
   'WuBook' => IlGala\LaravelWubook\Facades\WuBook::class
],
```

Configuration
-------------

[](#configuration)

Laravel WuBook requires connection configuration.

To get started, you'll need to publish all vendor assets:

```
$ php artisan vendor:publish

# OR

$ php artisan vendor:publish --provider=IlGala\LaravelWubook\WuBookServiceProvider
```

This will create a `config/wubook.php` file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.

##### Account parameters

[](#account-parameters)

```
[
    'username' => 'your-user',
    'password' => 'your-password',
    'provider_key' => 'your-provider-key',
    'lcode' => 'your-lcode',
]
```

The `lcode` parameter is a property ID provided by WuBook and you can find it the main control panel within the profile management section.

The `provider_key` is released by the WuBook development team and if you need to create a new key associated with your WuBook account, please write an E-Mail at .

##### `cache_token` parameter

[](#cache_token-parameter)

If `cache_token` parameter is set to true, all the API function will use a cached value and automatically renew it if necessary. If you need to retrieve the current token, call the method

```
Cache::get('wubook.token')     // ex. '9869117656.9552'
```

The package will store also a 'wubook.token.ops' key, in order to trace the number of calls made with current token, in order to refresh it if the maximum number of operation has been reached.

**Attention:** If `cache_token` is set to false, the package will not check if the token has exceeded the maximum number of operations!

The values stored inside the cache will expire after 3600 seconds and if the `cache_token` parameter is set to true it will be automatically renewed. Please read

Usage
-----

[](#usage)

##### WuBookManager

[](#wubookmanager)

This is the class of most interest. It is bound to the ioc container as `'wubook'` and can be accessed using the `Facades\WuBook` facade. In order to make a call to the Wired API, you may call these methods that refers to a specific area of the service.

- `auth()`: please read the [authentication documentation](http://tdocs.wubook.net/wired/auth.html)
- `availability()`: please read the [availabity documentation](http://tdocs.wubook.net/wired/avail.html)
- `cancellation_policies()`: please read the [cancellation policies documentation](http://tdocs.wubook.net/wired/cpolicies.html)
- `channel_manager()`: please read the [channel manager documentation](http://tdocs.wubook.net/wired/woodoo.html)
- `corporate_functions()`: please read the [corporate functions documentation](http://tdocs.wubook.net/wired/corps.html)
- `extras()`: please read the [extras documentation](http://tdocs.wubook.net/wired/extras.html)
- `prices()`: please read the [prices documentation](http://tdocs.wubook.net/wired/prices.html)
- `reservations()`: please read the reservations documentation ([fetching](http://tdocs.wubook.net/wired/fetch.html), [handling](http://tdocs.wubook.net/wired/rsrvs.html))
- `restrictions()`: please read the [restrictions documentation](http://tdocs.wubook.net/wired/rstrs.html)
- `rooms()`: please read the [rooms documentation](http://tdocs.wubook.net/wired/rooms.html)
- `transactions()`: please read the [transactions documentation](http://tdocs.wubook.net/wired/transactions.html)

##### Facades\\WuBook

[](#facadeswubook)

This facade will dynamically pass static method calls to the `'wubook'` object in the ioc container which by default is the `WuBookManager` class.

##### WuBookServiceProvider

[](#wubookserviceprovider)

This class contains no public methods of interest. This class should be added to the providers array in `config/app.php`. This class will setup ioc bindings.

##### WuBook API methods results

[](#wubook-api-methods-results)

The [fxmlrpc client](https://github.com/lstrojny/fxmlrpc) always returns an associative array, that may be changed by the package in order to retrieve the resulting data from the XML/RPC function.

If an error occured during the call, a `WuBookException` will be thrown. If the call is successfully executed (see ) an array will be returned with this values:

```
// An error occurred
return [
    'has_error' => true,
    'data' => 'A human readeable error message'
]

// Success
return [
    'has_error' => false,
    'data' => [ /* THE XML/RPC FUNCTION RESPONSE */ ]
]
```

Only the `WuBookAuth` API returns different values for a successful call:

```
acquire_token()
// returns a string (ex. '9869117656.9552'), throws an exception otherwise

release_token($token)
// returns a boolean if the token is successfully released, throws an exception otherwise

is_token_valid($token, $request_new = false)
// - if the token is valid returns an integer representing the total operations made with the token
// - if `request_new` is set to `true` and the token is not valid the method `aquire_token()` is called
// - false otherwise

provider_info($token = null)
// returns an array with the provider infos
```

##### Real Examples

[](#real-examples)

Here you can see an example of just how simple this package is to use. Out of the box, the default `cache_token` parameter is set to false so:

```
use IlGala\LaravelWuBook\Facades\WuBook;
// you can alias this in config/app.php if you like

// Retrieve the token
$token = WuBook::auth()->acquire_token()        // (ex. '9869117656.9552')

WuBook::rooms()->fetch_rooms(1)                 // See http://tdocs.wubook.net/wired/rooms.html#fetching-existing-rooms
// this example is simple, and there are far more methods available
// The result will be an associative array with this structure

[
    0 => [
        id => 123,
        name => 'room',
        shortname => 'ro',
        occupancy => 2,
        men => 2,
        children => 0,
        subroom => 0,
        // ...
    ],
    1 => [
        // ...
    ],
]
```

If you prefer to use dependency injection over facades like me, then you can easily inject the manager like so:

```
use IlGala\LaravelWuBook\WuBookManager;
use Illuminate\Support\Facades\App; // you probably have this aliased already

class RoomManager
{
    protected $wubook;

    public function __construct(WuBookManager $wubook)
    {
        $this->wubook = $wubook;
    }

    public function fetch_rooms($ancillary = 0)
    {
        $this->wubook->fetch_rooms($ancillary);
    }
}

App::make('RoomManager')->fetch_rooms(1);
```

For more information on how to use the `\LaravelWubook\WuBookManager` class we are calling behind the scenes here, check out the [Wired API doc](http://tdocs.wubook.net/wired.html).

##### Further Information

[](#further-information)

There are other classes in this package that are not documented here. This is because they are not intended for public use and are used internally by this package.

Security
--------

[](#security)

If you discover a security vulnerability within this package, please send an e-mail to Filippo Galante at . All security vulnerabilities will be promptly addressed.

License
-------

[](#license)

Laravel WuBook is licensed under [The MIT License (MIT)](LICENSE).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/bcd582fcb8d6129305d8f72485d53593551e4ddd87ec3d322f92875f9ad4366d?d=identicon)[IlGala](/maintainers/IlGala)

---

Top Contributors

[![ilgala](https://avatars.githubusercontent.com/u/1577699?v=4)](https://github.com/ilgala "ilgala (6 commits)")

---

Tags

laravellaravel-5-packagewubook

### Embed Badge

![Health badge](/badges/ilgala-laravel-wubook/health.svg)

```
[![Health](https://phpackages.com/badges/ilgala-laravel-wubook/health.svg)](https://phpackages.com/packages/ilgala-laravel-wubook)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
