rana-tuhin/hostaway-php-sdk
最新稳定版本:v1.0.0
Composer 安装命令:
composer require rana-tuhin/hostaway-php-sdk
包简介
A fully-featured PHP SDK for the Hostaway API with all available endpoints and resources.
README 文档
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([]);
统计信息
- 总下载量: 23
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-01