Flexible PHP SDK for the Airtable API.
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+
$ composer require beachcasts/airtable-sdk-php
Base usage requires instantiation of the AirtableClient, as shown below:
require_once('vendor/autoload.php'); use Beachcasts\Airtable\AirtableClient; use Beachcasts\Airtable\Config; // Add details to your environment - see documentation for recomendations $airtableClient = new AirtableClient(Config::fromEnvironment(), <your_baseid>); $table = $airtableClient->getTable(<your_table_name>);
For more details of how to use the AirtableClient, see the /docs, where examples highlight using
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 install
Running the unit tests is simply telling phpunit to run the "unit" testsuite
$ vendor/bin/phpunit --testsuite=unit
Running the integration tests will require an actual account and details from Airtable.
- Copy the file
- Log into your Airtable account
Add a baseusing the
Start from scratchmethod. Let the new base creation retain the default
- Visit Airtable API docs and select your
- Copy the Base ID from the Introduction section. Look for
The ID of this base isAdd this to the
- Go to Your account and copy your API Key.
Add this to the
- If you have changed the default Table name away from
Table 1- update the
Once the .env is configured, tests can be run with the following command:
$ vendor/bin/phpunit --testsuite=integration
To 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=full
To maintain quality control, we maintain use of the following standards:
- PSR-2 Coding Standard,
- PSR-4 standard for Autoload locations (via composer)
- PSR-7 standard for HTTP messages (via GuzzleHttp implementation)
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 src
If you discover any security related issues, please email email@example.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.