PHP code example of rana-tuhin / hostaway-php-sdk

1. Go to this page and download the library: Download rana-tuhin/hostaway-php-sdk 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/ */

    

rana-tuhin / hostaway-php-sdk example snippets


return [
    'api_key' => env('HOSTAWAY_API_KEY'),
    'account_id' => env('HOSTAWAY_ACCOUNT_ID'),
    'base_url' => env('HOSTAWAY_BASE_URL', 'https://api.hostaway.com/v1/'),
];

use Hostaway;

$listings = Hostaway::listings()->getAll();

$reservations = Hostaway::reservations()->getAll();

Hostaway::messages()->send([
    'reservationId' => 1001,
    'content' => 'Welcome to our property!',
]);

use RanaTuhin\Hostaway\HostawayClient;

$client = new HostawayClient([
    'api_key' => 'your-api-key',
    'account_id' => 'your-account-id',
]);

$listings = $client->listings()->getAll();
$reservation = $client->reservations()->find(12345);

$listings = $client->listings()->getAll();
$reservation = $client->reservations()->create([]);
bash
php artisan vendor:publish --tag=hostaway-config