PHPackages                             tapp/laravel-airtable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tapp/laravel-airtable

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tapp/laravel-airtable
=====================

Laravel Airtable SDK

v3.1.0(2mo ago)113260.9k↓34.1%35[15 issues](https://github.com/TappNetwork/laravel-airtable/issues)[2 PRs](https://github.com/TappNetwork/laravel-airtable/pulls)MITPHPPHP ^8.2 || ^8.3 || ^8.4CI failing

Since Feb 22Pushed 2mo ago10 watchersCompare

[ Source](https://github.com/TappNetwork/laravel-airtable)[ Packagist](https://packagist.org/packages/tapp/laravel-airtable)[ Docs](https://github.com/tapp/laravel-airtable)[ RSS](/packages/tapp-laravel-airtable/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (28)Versions (31)Used By (0)

Laravel SDK for Airtable
========================

[](#laravel-sdk-for-airtable)

[![Latest Stable Version](https://camo.githubusercontent.com/15221b7e9511a27135ab1f2e95c13d29d7282dc85270408dd592026f627d6f73/68747470733a2f2f706f7365722e707567782e6f72672f746170702f6c61726176656c2d6169727461626c652f762f737461626c65)](https://packagist.org/packages/tapp/laravel-airtable)[![Code Style Action Status - Pint](https://github.com/TappNetwork/laravel-airtable/actions/workflows/pint.yml/badge.svg)](https://github.com/TappNetwork/laravel-airtable/actions/workflows/pint.yml/badge.svg)[![PHPStan](https://github.com/TappNetwork/laravel-airtable/actions/workflows/phpstan.yml/badge.svg)](https://github.com/TappNetwork/laravel-airtable/actions/workflows/phpstan.yml/badge.svg)[![Tests](https://github.com/TappNetwork/laravel-airtable/actions/workflows/run-tests.yml/badge.svg)](https://github.com/TappNetwork/laravel-airtable/actions/workflows/run-tests.yml/badge.svg)[![Quality Score](https://camo.githubusercontent.com/2898f6592ed54b966fd007990819b6ece0a143343f721f14b6ed4ca3429498f4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f546170704e6574776f726b2f6c61726176656c2d6169727461626c65732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/TappNetwork/laravel-airtables/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/5dd256deb880a58e4e065b39c5f70f452586721b2780a465d76f5024a520d8dc/68747470733a2f2f706f7365722e707567782e6f72672f746170702f6c61726176656c2d6169727461626c652f646f776e6c6f616473)](https://packagist.org/packages/tapp/laravel-airtable)

A simple approach to interacting with Airtables.

Installation
------------

[](#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_TYPECAST=false
```

- `AIRTABLE_KEY` Airtable is requiring personal access tokens for Authorization starting in 2024. A token can be created here: . If you are upgrading from an API key to access token, simply replace the value previously held in this environment variable with your new token.
- `AIRTABLE_BASE` can be found here: , 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`
- `AIRTABLE_TYPECAST` set this to true to allow automatic casting.

Example Config
--------------

[](#example-config)

If you need to support multiple tables, add them to the tables config in the config/airtable.php If your table is on a different base than the one set in the env, add that as well.

```
...
    'tables' => [

        'default' => [
            'name' => env('AIRTABLE_TABLE', 'Main'),
            'base' => 'base_id',
        ],

        'companies' => [
            'name' => env('AIRTABLE_COMPANY_TABLE', 'Companies'),
            'base' => 'base_id',
        ],
        ...
    ],
...

```

Usage
-----

[](#usage)

### Import the facade in your class.

[](#import-the-facade-in-your-class)

```
use Airtable;
```

#### Get records from that table

[](#get-records-from-that-table)

- This will only return the first 100 records due to Airtable page size limiation

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

#### Get all records from that table.

[](#get-all-records-from-that-table)

- This will get all records by sending multiple requests until all record are fetched.
- Optional Parameter which is the delay between requests in microseconds as API is limited to 5 requests per second per base, defaults to 0.2 second.

```
Airtable::table('tasks')->all();
Airtable::table('tasks')->all(500000); // 0.5 seconds
```

#### Get one record from the default table.

[](#get-one-record-from-the-default-table)

```
Airtable::find('id_string');
```

#### Filter records

[](#filter-records)

- First argument is the column name
- Second argument is the operator or the value if you want to use equal '=' as an operator.
- Third argument is the value of the filter

```
Airtable::where('id', '5')->get();
Airtable::where('id', '>', '5')->get();
```

### Filter records by formula

[](#filter-records-by-formula)

- When using `where` is not enough you may need to pass in raw filter values.
- [Airtable reference](https://support.airtable.com/docs/formula-field-reference)

```
Airtable::table('tasks')->filterByFormula('OR({id} = "abc", {id} = "def", {id} = "ghi")')->get();
```

#### Sorting records

[](#sorting-records)

- First argument is the column name
- Second argument is the sort direction: `asc` (default) or `desc`

```
Airtable::orderBy('id')->get();
Airtable::orderBy('created_at', 'desc')->get();
```

You can sort by multiple fields by calling `orderBy` more than once (a single call with array syntax is not supported):

```
Airtable::orderBy('id')->orderBy('created_at', 'desc')->get();
```

#### Set other API Parameters

[](#set-other-api-parameters)

```
Airtable::addParam('returnFieldsByFieldId', true); // one param at a time
Airtable::params(['returnFieldsByFieldId' => true, 'view' => 'My View']) // multiple params at once
```

#### Create

[](#create)

- Insert a record

```
Airtable::create(['name' => 'myName']);
```

#### First or Create

[](#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

[](#update-or-create)

- First argument will be used to find existing
- Second argument is additional data to save when we create or update

```
Airtable::updateOrCreate(['name' => 'myName'], ['field' => 'myField']);

Airtable::table('companies')->firstOrCreate(['Company Name' => $team->name]);
```

#### Update

[](#update)

- First argument will be the id
- Second argument is the whole record including the updated fields

**Note:** Update is destructive and clear all unspecified cell values if you did not provide a value for them. use PATCH up update specified fields

```
Airtable::table('companies')->update('rec5N7fr8GhDtdNxx', [ 'name' => 'Google', 'country' => 'US']);
```

#### Patch

[](#patch)

- First argument will be the id
- Second argument is the field you would like to update

```
Airtable::table('companies')->patch('rec5N7fr8GhDtdNxx', ['country' => 'US']);
```

#### Mass Update or Patch

[](#mass-update-or-patch)

- Array of data to be updated or patched

```
Airtable::table('companies')->patch([
    [
        'id' => 'rec5N7fr8GhDtdNxx',
        'fields' => ['country' => 'US']
    ],
    [
        'id' => 'rec8BhDt4fs2',
        'fields' => ['country' => 'UK']
    ],
    ...
]);
```

#### Destroy

[](#destroy)

- Destroy a record

```
Airtable::table('companies')->destroy('rec5N7fr8GhDtdNxx');
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

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

Credits
-------

[](#credits)

- [Steve Williamson](https://github.com/tapp)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

68

—

FairBetter than 99% of packages

Maintenance83

Actively maintained with recent releases

Popularity52

Moderate usage in the ecosystem

Community30

Small or concentrated contributor base

Maturity89

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~93 days

Recently: every ~216 days

Total

29

Last Release

72d ago

Major Versions

v0.21 → v1.02021-09-16

v1.4 → v2.02023-02-15

v2.3 → v3.0.02025-03-18

PHP version history (5 changes)0.5PHP ^7.1

v0.20PHP ^7.1 || ^8.0

v1.0PHP ^7.3 || ^8.0

v2.2PHP ^7.4 || ^8.0 || ^8.1 || ^8.2 || ^8.3

v3.0.0PHP ^8.2 || ^8.3 || ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/837400?v=4)[tapp](/maintainers/tapp)[@tapp](https://github.com/tapp)

![](https://avatars.githubusercontent.com/u/7796074?v=4)[Scott Grayson](/maintainers/scottgrayson)[@scottgrayson](https://github.com/scottgrayson)

![](https://avatars.githubusercontent.com/u/413354?v=4)[andreiabohner](/maintainers/andreiabohner)[@andreiabohner](https://github.com/andreiabohner)

![](https://avatars.githubusercontent.com/u/29612767?v=4)[johnwesely](/maintainers/johnwesely)[@johnwesely](https://github.com/johnwesely)

![](https://www.gravatar.com/avatar/098c516353ec886f976c4079004fac2502b619b37889deff70fe33abb1d30209?d=identicon)[swilla](/maintainers/swilla)

---

Top Contributors

[![swilla](https://avatars.githubusercontent.com/u/304159?v=4)](https://github.com/swilla "swilla (28 commits)")[![scottgrayson](https://avatars.githubusercontent.com/u/7796074?v=4)](https://github.com/scottgrayson "scottgrayson (14 commits)")[![albalooshi](https://avatars.githubusercontent.com/u/13213888?v=4)](https://github.com/albalooshi "albalooshi (4 commits)")[![andreia](https://avatars.githubusercontent.com/u/38911?v=4)](https://github.com/andreia "andreia (4 commits)")[![yassinebourakba](https://avatars.githubusercontent.com/u/28701148?v=4)](https://github.com/yassinebourakba "yassinebourakba (4 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (3 commits)")[![gustavosobrinho01](https://avatars.githubusercontent.com/u/16225726?v=4)](https://github.com/gustavosobrinho01 "gustavosobrinho01 (2 commits)")[![johnwesely](https://avatars.githubusercontent.com/u/29612767?v=4)](https://github.com/johnwesely "johnwesely (1 commits)")[![jokosusilo](https://avatars.githubusercontent.com/u/6588022?v=4)](https://github.com/jokosusilo "jokosusilo (1 commits)")[![kevnk](https://avatars.githubusercontent.com/u/1181420?v=4)](https://github.com/kevnk "kevnk (1 commits)")[![mbreithu](https://avatars.githubusercontent.com/u/8034517?v=4)](https://github.com/mbreithu "mbreithu (1 commits)")[![mo7amed-3bdalla7](https://avatars.githubusercontent.com/u/11799413?v=4)](https://github.com/mo7amed-3bdalla7 "mo7amed-3bdalla7 (1 commits)")[![cassolmedia](https://avatars.githubusercontent.com/u/3106931?v=4)](https://github.com/cassolmedia "cassolmedia (1 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")[![asugai](https://avatars.githubusercontent.com/u/2228791?v=4)](https://github.com/asugai "asugai (1 commits)")[![Synchro](https://avatars.githubusercontent.com/u/81561?v=4)](https://github.com/Synchro "Synchro (1 commits)")[![dsferruzza](https://avatars.githubusercontent.com/u/1931963?v=4)](https://github.com/dsferruzza "dsferruzza (1 commits)")[![chriship](https://avatars.githubusercontent.com/u/4815637?v=4)](https://github.com/chriship "chriship (1 commits)")[![gabrieltakacs](https://avatars.githubusercontent.com/u/6212368?v=4)](https://github.com/gabrieltakacs "gabrieltakacs (1 commits)")

---

Tags

airtablescomposerhacktoberfesthacktoberfest2021laravellaravel-airtablesphplaravelairtabletapp

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/tapp-laravel-airtable/health.svg)

```
[![Health](https://phpackages.com/badges/tapp-laravel-airtable/health.svg)](https://phpackages.com/packages/tapp-laravel-airtable)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[nativephp/mobile

NativePHP for Mobile

1.1k75.1k91](/packages/nativephp-mobile)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[oat-sa/tao-core

TAO core extension

66143.7k122](/packages/oat-sa-tao-core)[venturedrake/laravel-crm

A free open source CRM built as a package for laravel projects

43311.1k](/packages/venturedrake-laravel-crm)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
