Skip to content

Commit 36bf122

Browse files
committed
update readme
1 parent 5890a01 commit 36bf122

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,33 @@ AIRTABLE_TABLE=
3333
* `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`
3434
* `AIRTABLE_TABLE` can be found in the docs for the appropriate base, this is not case senstive. IE: `tasks`
3535

36+
## Example Config
37+
38+
If you need to support multiple tables, add them to the tables config in the config/airtable.php
39+
40+
```
41+
...
42+
'tables' => [
43+
44+
'default' => [
45+
'name' => env('AIRTABLE_TABLE', 'Main'),
46+
],
47+
48+
'companies' => [
49+
'name' => env('AIRTABLE_COMPANY_TABLE', 'Companies'),
50+
],
51+
...
52+
],
53+
...
54+
```
55+
3656
## Usage
3757

58+
### Import the facade in your class.
59+
```php
60+
use Airtable;
61+
```
62+
3863
#### Get all records from that table.
3964
``` php
4065
Airtable::table('tasks')->get();
@@ -43,7 +68,6 @@ Airtable::table('tasks')->get();
4368
#### Get one record from the default table.
4469
``` php
4570
Airtable::find('id_string');
46-
4771
```
4872

4973
#### Filter records
@@ -63,6 +87,8 @@ Airtable::firstOrCreate(['name' => 'myName'], ['field' => 'myField']);
6387
- Second argument is additional data to save when we create or update
6488
``` php
6589
Airtable::updateOrCreate(['name' => 'myName'], ['field' => 'myField']);
90+
91+
Airtable::table('companies')->firstOrCreate(['Company Name' => $team->name]);
6692
```
6793

6894
### Testing

0 commit comments

Comments
 (0)