rana-tuhin / hostaway-php-sdk
A fully-featured PHP SDK for the Hostaway API with all available endpoints and resources.
v1.0.0
2025-11-01 10:40 UTC
Requires
- php: >=8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- pestphp/pest: ^4.0
- phpstan/phpstan: ^1.0
This package is auto-updated.
Last update: 2026-03-30 19:22:53 UTC
README
A modern PHP SDK for the Hostaway API, designed to simplify integration with Hostaway’s property management system — including reservations, listings, messages, guests, and more.
🚀 Features
- Clean, fluent API for all Hostaway endpoints
- Built-in authentication with API Key
- Full Laravel support (auto-discovery, facade, and config)
- Pest-powered testing
- PSR-4 compliant and publishable config
📦 Installation
Install the package via Composer:
composer require rana-tuhin/hostaway-php-sdk
⚙️ Configuration
After installation, publish the configuration file:
php artisan vendor:publish --tag=hostaway-config
Then, set your credentials in .env:
HOSTAWAY_API_KEY=your-hostaway-api-key HOSTAWAY_ACCOUNT_ID=your-account-id HOSTAWAY_BASE_URL=https://api.hostaway.com/v1/
Your config/hostaway.php will look like:
return [ 'api_key' => env('HOSTAWAY_API_KEY'), 'account_id' => env('HOSTAWAY_ACCOUNT_ID'), 'base_url' => env('HOSTAWAY_BASE_URL', 'https://api.hostaway.com/v1/'), ];
Example Usage in Laravel
use Hostaway; $listings = Hostaway::listings()->getAll(); $reservations = Hostaway::reservations()->getAll(); Hostaway::messages()->send([ 'reservationId' => 1001, 'content' => 'Welcome to our property!', ]);
🧠 Usage (Standalone PHP)
You can use the client independently from Laravel too:
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);
Example:
$listings = $client->listings()->getAll(); $reservation = $client->reservations()->create([]);