zlt/airtable
最新稳定版本:v0.2.1
Composer 安装命令:
composer require zlt/airtable
包简介
Easy To Use PHP SDK for Airtable API
README 文档
README
This package also supports easy to use Search feature which is implemented under the hood of
filterByFormulaparameter. Check here for more details.
Table Of Contents
Installation
$ composer require zlt/airtable
Usage
-
Initialize
$client = new Client('token');
The base api endpoint is
https://api.airtable.com/v0/. You can change it by specifying the second parameter of the constructor.$client = new Client('token','custom-endpoint');
-
How to get appId, tableId and viewId
The format of the url is
https://airtable.com/{appId}/{tableId}/{viewId}. -
Set appId
$client->setAppId('appId');
-
Set tableId
$client->setTable('tableId');
-
Create a record
$client->create([ 'field1' => 'value1', 'field2' => 'value2', ]);
-
Create multiple records
$client->createMany([[ 'field1' => 'value1', 'field2' => 'value2', ],[ 'field1' => 'value1', 'field2' => 'value2', ]]);
-
Get a record
$client->get('recordId');
-
Get multiple records
$client->get(['recordId1','recordId2']);
-
Get all records in table
$client->all();
-
Update a record
$client->update('recordId',[ 'field1' => 'value1', 'field2' => 'value2', ]);
-
Update multiple records
$client->updateMany([ 'recordId1' => [ 'field1' => 'value1', 'field2' => 'value2', ], 'recordId2' => [ 'field1' => 'value1', 'field2' => 'value2', ], ]);
-
Delete a record
$client->delete('recordId');
-
Delete multiple records
$client->deleteMany(['recordId1','recordId2']);
-
Search
You can perform operations such as
where,whereOr,whereNot, andand.$client->search() ->whereNot('Name', 'Doe') ->whereOr('Name', 'John') ->and(function ($search) { return $search->where('Status', 'Active'); }) ->get()
Support me
I would be really appreciated if you buy me a coffee via Binance. 😄😄
统计信息
- 总下载量: 195
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-09-23