wasico / sdk-php
Wasi SDK PHP
v0.6.06
2024-03-26 17:59 UTC
Requires
- php: >=7.1.0
- dev-master
- v0.6.06
- v0.6.05
- v0.6.03
- v0.6.01
- v0.5.22
- v0.5.21
- v0.5.20
- v0.5.19.2
- v0.5.19
- v0.5.18
- v0.5.17
- v0.5.16
- v0.5.15
- v0.5.14
- v0.5.13
- v0.5.12
- v0.5.11
- v0.5.10
- v0.5.9
- v0.5.8
- v0.5.7
- v0.5.6
- v0.5.5
- v0.5.4
- v0.5.3
- v0.5.2
- v0.5.1
- v0.5.0
- v0.4.5
- v0.4.4
- v0.4.1
- v0.4.0
- v0.3.6
- v0.3.4
- v0.3.3
- v0.3.1
- v0.3.0
- v0.2.9
- v0.2.8
- v0.2.7
- v0.2.6
- v0.2.4
- v0.2.1
- v0.1.9
- v0.1.5
- v0.1.0
- v0.0.3
- v0.0.2
- v0.0.1
- dev-feature/createAndUpdate
This package is not auto-updated.
Last update: 2024-09-25 22:14:25 UTC
README
您可以在 https://wasi.co 上注册 Wasi 账户 并获取您的 id_company 和 wasi_token
需求
PHP 7.1.* 及以上版本。
安装
Composer
您可以通过 Composer 安装绑定。运行以下命令
composer require wasico/sdk-php
要使用绑定,使用 Composer 的 自动加载
require_once('vendor/autoload.php');
或手动添加到您的 composer.json 文件以进行常数更新
"wasico/sdk-php": ">=0.0.1"
首次配置
在执行时间中只设置一次您的配置
\Wasi\SDK\Configuration::set([ 'v' => 1, //API version here 'id_company' => 123456, //Your id_company here 'wasi_token' => 'AbCd_eFgH_IjKl_MnOp', //Your WasiToken here ]);
使用
使用 Wasi 模型 (\Wasi\SDK\Models) 获取 API 对象
查找一个元素
#Replace 123456 with the id_property $property = \Wasi\SDK\Models\Property::find(123456);
过滤并获取元素
#Use API filters in the 'where' method $properties = \Wasi\SDK\Models\Property::where('title', 'Hotel')->get();
创建一个元素
$customer = new \Wasi\SDK\Models\Customer(); $customer->id_user = 123; $customer->id_country = 1; $customer->id_region = 26; $customer->id_city = 63; $customer->first_name = "Jose W"; $customer->save() #Now you can get id_client: $id_client = $customer->id_client;
更新一个元素
$customer = \Wasi\SDK\Models\Customer::find(4321); $customer->last_name = 'Capera'; $customer->save()