PHP code example of and48 / laravel-wubook

1. Go to this page and download the library: Download and48/laravel-wubook library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

and48 / laravel-wubook example snippets


// An error occurred
return [
    'has_error' => true,
    'code' => -100,
    'data' => 'A human readeable error message'
];

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

use AND48\LaravelWubook\Facades\WuBook;
use AND48\LaravelWubook\Models\WubookConfig;

$credentials = WubookConfig::find(1)->only(['lcode', 'token']);
WuBook::rooms($credentials)->fetch_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 => [
        // ...
    ],
];
bash
php artisan vendor:publish --provider="AND48\LaravelWubook\WuBookServiceProvider" --tag="migrations"