tourware/sdk-php
Composer 安装命令:
composer require tourware/sdk-php
包简介
PHP SDK for the flowcore API.
README 文档
README
Official PHP client for the tourware REST API
The tourware PHP SDK provides a clean, consistent, and extensible PHP interface to the tourware REST API.
It simplifies authentication, querying, filtering, pagination, and interaction with all tourware resources such as Travels, Bookings, Customers, and more.
The SDK is designed for modern PHP applications, including Laravel and Symfony, but works with any PSR-4 compatible project.
📦 Installation
Install via Composer:
composer require tourware/sdk-php
Load the package:
require 'vendor/autoload.php';
🚀 Quick Start
use tourware\Client; // Create a client for the flowcore API (staging by default) $client = Client::create( xApiKey: 'YOUR_X_API_KEY' ); // Production: $prodClient = Client::create( xApiKey: 'YOUR_X_API_KEY', staging: false ); // Example: Fetch a travel record $travel = $client->travels()->find('60feacb365f5f1002750c2b2');
🧭 Working With Entities
Each API resource has a dedicated client.
Accessing entities:
$client->travel()->find('id'); $client->booking()->list(); $client->customer()->create([...]);
Using entity classes:
use tourware\Entities\Travel; $travel = $client->entity(new Travel)->find('id');
Raw access:
$travel = $client->raw('travels')->find('id');
🔍 Query Builder
The SDK includes a fluent query builder.
$travels = $client ->travel() ->query() ->filter('title')->contains('Kenya') ->filter('price.adult')->gte(1500) ->sort('updatedAt')->desc() ->offset(0) ->limit(20) ->get();
Dot-notation access:
$title = $travels->get('records.0.title'); $firstName = $travels->get('records.0.responsibleUser.firstname');
💥 CRUD Operations
Create
$client->travel()->create([ 'title' => 'New Travel Package', ]);
Read
$client->travel()->find('id');
Update
$client->travel()->update('id', [ 'title' => 'Updated Title', ]);
Delete
$client->travel()->delete('id');
List
$client->travel()->list(offset: 0, limit: 50);
⚙️ Custom Requests
$response = $client ->custom("/relations/getRelations/travels/bba0b42e4699", method: 'GET') ->call();
🛡️ Error Handling
try { $travel = $client->travel()->find('id'); } catch (\tourware\Exceptions\ApiException $e) { echo "API Error: " . $e->getMessage(); } catch (\Exception $e) { echo "General Error: " . $e->getMessage(); }
🧪 Testing
composer test
🎯 Best Practices
- Store API keys in environment variables
- Prefer Query Builder over raw endpoints
- Wrap API calls in
try/catch - Log API requests and responses
- Keep SDK updated regularly
🤝 Contributing
Contributions are welcome!
Please check the CONTRIBUTING.md and CODE_OF_CONDUCT.md before submitting a PR.
🔒 Security
If you discover a security vulnerability, please email:
Do not create public issues for security topics.
📜 Changelog
See:
CHANGELOG.md
🧑💻 Maintainers & Credits
- Official maintainers from tourware
- Community contributors
Licensed under MIT License.
🌟 Why Use This SDK?
- Clean & intuitive API
- Fully PSR-4 compliant
- Flexible Query Builder
- Supports all tourware endpoints
- Ideal for Laravel, Symfony & general PHP apps
- Built for tour operators, DMCs and travel platforms
“This SDK gives you a modern, stable, and scalable foundation for any tourware integration — from small tools to full enterprise platforms.”
🚀 Happy Coding!
tourware/sdk-php 适用场景与选型建议
tourware/sdk-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.56k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 09 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sdk-php」 「tourware」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 tourware/sdk-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tourware/sdk-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 tourware/sdk-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
An sdk to interact with Braze API
A PHP client library that provides a native interface to the official Todoist REST API.
Ruwler SDK PHP
SDK for madkting platform
Leopards Courier COD (Cash on Delivery) API Wrapper for PHP
Ruwler SDK Bundle
统计信息
- 总下载量: 4.56k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-17