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.
Go to: https://beachcasts.github.io/airtable-sdk-php/
Via Composer
$ composer require beachcasts/airtable-sdk-phpBase usage requires instantiation of the AirtableClient, as shown below:
require_once('vendor/autoload.php');
use BeachcastsAirtableAirtableClient;
use BeachcastsAirtableConfig;
// Add details to your environment - see documentation for recomendations
$airtableClient = new AirtableClient(Config::fromEnvironment(), <your_baseid>);
$table = $airtableClient->getTable(<your_table_name>);<your_baseid> and <your_table_name> as needed.Config::fromEnvironmentFor more details of how to use the AirtableClient, see the /docs, where examples highlight using create(), read(), update(), delete(), and list() methods on/with Airtable data.
Please see CHANGELOG for more information on what has changed recently.
Airtable-SDK has 3 Test Suites: Full, Unit and Integration, we include a Dev requirement against PHPUnit. Please make sure you run the composer install to get all dependencies.
$ composer installRunning the unit tests is simply telling phpunit to run the "unit" testsuite
$ vendor/bin/phpunit --testsuite=unitRunning the integration tests will require an actual account and details from Airtable.
tests.env.default to tests.envAdd a base using the Start from scratch method.
Let the new base creation retain the default Untitled Base name.BaseThe ID of this base is
Add this to the tests.env under the TEST_BASE_ID keytests.env under the AIRTABLE_API_KEY keyTable 1 - update the TEST_TABLE_NAME in the tests.envOnce the .env is configured, tests can be run with the following command:
$ vendor/bin/phpunit --testsuite=integrationTo run the full Test Suite, you will need to follow the steps outlined for Integration testing. To Exceute, run the following command:
$ vendor/bin/phpunit --testsuite=fullor
$ vendor/bin/phpunitTo maintain quality control, we maintain use of the following standards:
We provide a phpcs.xml.dist within the codebase to validate the Coding standard using Code Sniffer (included as dev dependency in our composer.json manifest)
To run the codesniffer against the codebase, use the following command.
$ vendor/bin/phpcs --standard=phpcs.xml.dist srcPlease 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.