/laravel-airtable

Airtables Client for Laravel

Primary LanguagePHPMIT LicenseMIT

Laravel SDK for Airtable

Latest Stable Version StyleCI Quality Score Total Downloads

A simple approach to interacting with Airtables.

Installation

You can install the package via composer:

composer require tapp/laravel-airtable

Publish the config file:

php artisan vendor:publish --provider="Tapp\Airtable\AirtableServiceProvider"

Define airtables account information in .env:

AIRTABLE_KEY=
AIRTABLE_BASE=
AIRTABLE_TABLE=
  • AIRTABLE_KEY can be retrieved here: https://airtable.com/account
  • AIRTABLE_BASE can be found here: https://airtable.com/api, select base then copy from URL: https://airtable.com/[Base Is Here]/api/docs#curl/introduction
  • AIRTABLE_TABLE can be found in the docs for the appropriate base, this is not case senstive. IE: tasks

Usage

Get all records from that table.

Airtable::table('tasks')->get();

Get one record from the default table.

Airtable::find('id_string');

Filter records

Airtable::where('name', 'myName')->get();

First or Create

  • First argument will be used for finding existing
  • Second argument is additional data to save if no results are found and we are creating (will not be saved used if item already exists)
Airtable::firstOrCreate(['name' => 'myName'], ['field' => 'myField']);

Update or Create

  • First argument will be used to find existing
  • Second argument is additional data to save when we create or update
Airtable::createOrUpdate(['name' => 'myName'], ['field' => 'myField']);

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email steve@tappnetwork.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.