{"id":22398746,"url":"https://github.com/tappnetwork/laravel-airtable","last_synced_at":"2025-04-12T03:45:21.924Z","repository":{"id":35122122,"uuid":"172130876","full_name":"TappNetwork/laravel-airtable","owner":"TappNetwork","description":"Airtables Client for Laravel","archived":false,"fork":false,"pushed_at":"2025-03-18T12:23:53.000Z","size":91,"stargazers_count":106,"open_issues_count":16,"forks_count":32,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-12T03:45:09.772Z","etag":null,"topics":["airtables","composer","hacktoberfest","hacktoberfest2021","laravel","laravel-airtables","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TappNetwork.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-22T20:33:40.000Z","updated_at":"2025-03-25T13:31:41.000Z","dependencies_parsed_at":"2024-05-04T22:24:48.987Z","dependency_job_id":"87451a05-a106-4b06-b634-fcbd40804f00","html_url":"https://github.com/TappNetwork/laravel-airtable","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TappNetwork%2Flaravel-airtable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TappNetwork%2Flaravel-airtable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TappNetwork%2Flaravel-airtable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TappNetwork%2Flaravel-airtable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TappNetwork","download_url":"https://codeload.github.com/TappNetwork/laravel-airtable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248514214,"owners_count":21116899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airtables","composer","hacktoberfest","hacktoberfest2021","laravel","laravel-airtables","php"],"created_at":"2024-12-05T07:12:02.909Z","updated_at":"2025-04-12T03:45:21.902Z","avatar_url":"https://github.com/TappNetwork.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel SDK for Airtable\n\n[![Latest Stable Version](https://poser.pugx.org/tapp/laravel-airtable/v/stable)](https://packagist.org/packages/tapp/laravel-airtable)\n![Code Style Action Status - Pint](https://github.com/TappNetwork/laravel-airtable/actions/workflows/pint.yml/badge.svg)\n![PHPStan](https://github.com/TappNetwork/laravel-airtable/actions/workflows/phpstan.yml/badge.svg)\n![Tests](https://github.com/TappNetwork/laravel-airtable/actions/workflows/run-tests.yml/badge.svg)\n[![Quality Score](https://scrutinizer-ci.com/g/TappNetwork/laravel-airtables/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/TappNetwork/laravel-airtables/?branch=master)\n[![Total Downloads](https://poser.pugx.org/tapp/laravel-airtable/downloads)](https://packagist.org/packages/tapp/laravel-airtable)\n\nA simple approach to interacting with Airtables.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require tapp/laravel-airtable\n```\n\nPublish the config file:\n\n```bash\nphp artisan vendor:publish --provider=\"Tapp\\Airtable\\AirtableServiceProvider\"\n```\n\nDefine airtables account information in .env:\n\n```bash\nAIRTABLE_KEY=\nAIRTABLE_BASE=\nAIRTABLE_TABLE=\nAIRTABLE_TYPECAST=false \n```\n\n* `AIRTABLE_KEY` Airtable is requiring personal access tokens for Authorization starting in 2024. A token can be created here: https://airtable.com/create/tokens. 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.\n* `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`\n* `AIRTABLE_TABLE` can be found in the docs for the appropriate base, this is not case senstive. IE: `tasks`\n* `AIRTABLE_TYPECAST` set this to true to allow automatic casting.\n\n## Example Config\n\nIf you need to support multiple tables, add them to the tables config in the config/airtable.php\nIf your table is on a different base than the one set in the env, add that as well.\n\n```\n...\n    'tables' =\u003e [\n\n        'default' =\u003e [\n            'name' =\u003e env('AIRTABLE_TABLE', 'Main'),\n            'base' =\u003e 'base_id',\n        ],\n\n        'companies' =\u003e [\n            'name' =\u003e env('AIRTABLE_COMPANY_TABLE', 'Companies'),\n            'base' =\u003e 'base_id',\n        ],\n        ...\n    ],\n...\n```\n\n## Usage\n\n### Import the facade in your class.\n```php\nuse Airtable;\n```\n\n#### Get records from that table\n- This will only return the first 100 records due to Airtable page size limiation\n\n``` php\nAirtable::table('tasks')-\u003eget();\n```\n\n#### Get all records from that table.\n- This will get all records by sending multiple requests until all record are fetched.\n- 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.\n``` php\nAirtable::table('tasks')-\u003eall();\nAirtable::table('tasks')-\u003eall(500000); // 0.5 seconds\n```\n\n#### Get one record from the default table.\n``` php\nAirtable::find('id_string');\n```\n\n#### Filter records\n- First argument is the column name\n- Second argument is the operator or the value if you want to use equal '=' as an operator.\n- Third argument is the value of the filter\n``` php\nAirtable::where('id', '5')-\u003eget();\nAirtable::where('id', '\u003e', '5')-\u003eget();\n```\n\n### Filter records by formula\n- When using `where` is not enough you may need to pass in raw filter values.\n- [Airtable reference](https://support.airtable.com/docs/formula-field-reference)\n``` php\nAirtable::table('tasks')-\u003efilterByFormula('OR({id} = \"abc\", {id} = \"def\", {id} = \"ghi\")')-\u003eget();\n```\n\n#### Sorting records\n\n- First argument is the column name\n- Second argument is the sort direction: `asc` (default) or `desc`\n\n``` php\nAirtable::orderBy('id')-\u003eget();\nAirtable::orderBy('created_at', 'desc')-\u003eget();\n```\nYou can sort by multiple fields by calling `orderBy` more than once (a single call with array syntax is not supported):\n```php\nAirtable::orderBy('id')-\u003eorderBy('created_at', 'desc')-\u003eget();\n```\n\n#### Set other API Parameters\n``` php\nAirtable::addParam('returnFieldsByFieldId', true); // one param at a time\nAirtable::params(['returnFieldsByFieldId' =\u003e true, 'view' =\u003e 'My View']) // multiple params at once\n```\n\n#### Create\n- Insert a record\n\n``` php\nAirtable::create(['name' =\u003e 'myName']);\n```\n\n#### First or Create\n- First argument will be used for finding existing\n- 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)\n``` php\nAirtable::firstOrCreate(['name' =\u003e 'myName'], ['field' =\u003e 'myField']);\n```\n\n#### Update or Create\n- First argument will be used to find existing\n- Second argument is additional data to save when we create or update\n``` php\nAirtable::updateOrCreate(['name' =\u003e 'myName'], ['field' =\u003e 'myField']);\n\nAirtable::table('companies')-\u003efirstOrCreate(['Company Name' =\u003e $team-\u003ename]);\n```\n\n#### Update \n- First argument will be the id\n- Second argument is the whole record including the updated fields\n\n**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\n\n``` php\nAirtable::table('companies')-\u003eupdate('rec5N7fr8GhDtdNxx', [ 'name' =\u003e 'Google', 'country' =\u003e 'US']);\n```\n\n#### Patch\n- First argument will be the id\n- Second argument is the field you would like to update\n``` php\nAirtable::table('companies')-\u003epatch('rec5N7fr8GhDtdNxx', ['country' =\u003e 'US']);\n```\n\n#### Mass Update or Patch\n- Array of data to be updated or patched\n\n``` php\nAirtable::table('companies')-\u003epatch([\n    [\n        'id' =\u003e 'rec5N7fr8GhDtdNxx',\n        'fields' =\u003e ['country' =\u003e 'US']\n    ],\n    [\n        'id' =\u003e 'rec8BhDt4fs2',\n        'fields' =\u003e ['country' =\u003e 'UK']\n    ],\n    ...\n]);\n```\n\n#### Destroy\n- Destroy a record\n\n``` php\nAirtable::table('companies')-\u003edestroy('rec5N7fr8GhDtdNxx');\n```\n\n### Testing\n\n``` bash\ncomposer test\n```\n\n### Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email steve@tappnetwork.com instead of using the issue tracker.\n\n## Credits\n\n- [Steve Williamson](https://github.com/tapp)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n## Laravel Package Boilerplate\n\nThis package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftappnetwork%2Flaravel-airtable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftappnetwork%2Flaravel-airtable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftappnetwork%2Flaravel-airtable/lists"}