This Airtable SDK for PHP makes it easier to leverage the Airtable API leveraging popular PHP conventions.
NOTE: This project is under active development, and is NOT ready for use.
- Composer installed globally
- PHP v7.2+
Via Composer
$ composer require beachcasts/airtable-sdk-php
Rename .env.default
to .env
, and update as needed.
Below is what a sample usage might look like, in the SDK current unfinished state.
require_once('vendor/autoload.php');
use Beachcasts\Airtable\Table;
use Beachcasts\Airtable\AirtableClient;
Dotenv\Dotenv::create(__DIR__)->load();
$baseId = '<base_id>';
$airtableClient = new AirtableClient($baseId);
$table = new Table('Content production');
$content = $table->list($airtableClient->getClient(), 'Content pipeline');
echo $content->getBody()->getContents();
Please see CHANGELOG for more information on what has changed recently.
Running the test suite requires the manual creation of a Base
at Airtable. Log into your Airtable account and Add a base
using the Start from scratch
method. Let the new base creation retain the default Untitled Base
name. You can customize as desired, but this will require you to also update the tests.
Next, you will need the base_id
in order to run the tests, as well as the api_key
. By going to the Airtable API docs you can now click into the new test base and view the base_id
. Likewise, you can check the box in the upper right to display the api key.
Add the key and id to the phpunit.xml
, which can be created from the phpunit.xml.dist
file.
Following that, tests can be run with the following command:
$ vendor/bin/phpunit
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.