File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -38,17 +38,20 @@ AIRTABLE_TYPECAST=false
38
38
## Example Config
39
39
40
40
If you need to support multiple tables, add them to the tables config in the config/airtable.php
41
+ If your table is on a different base than the one set in the env, add that as well.
41
42
42
43
```
43
44
...
44
45
'tables' => [
45
46
46
47
'default' => [
47
48
'name' => env('AIRTABLE_TABLE', 'Main'),
49
+ 'base' => 'base_id',
48
50
],
49
51
50
52
'companies' => [
51
53
'name' => env('AIRTABLE_COMPANY_TABLE', 'Companies'),
54
+ 'base' => 'base_id',
52
55
],
53
56
...
54
57
],
Original file line number Diff line number Diff line change @@ -100,17 +100,16 @@ public function setDefaultTable($name)
100
100
protected function resolve ($ name )
101
101
{
102
102
$ config = $ this ->getConfig ($ name );
103
-
104
103
if ($ config ) {
105
- return $ this ->createAirtable ($ config ['name ' ]);
104
+ return $ this ->createAirtable ($ config ['name ' ], array_key_exists ( ' base ' , $ config ) ? $ config [ ' base ' ] : false );
106
105
} else {
107
106
throw new InvalidArgumentException ("Table [ {$ name }] is not configured. " );
108
107
}
109
108
}
110
109
111
- protected function createAirtable ($ table )
110
+ protected function createAirtable ($ table, $ table_base = false )
112
111
{
113
- $ base = $ this ->app ['config ' ]['airtable.base ' ];
112
+ $ base = $ table_base ?: $ this ->app ['config ' ]['airtable.base ' ];
114
113
$ access_token = $ this ->app ['config ' ]['airtable.key ' ];
115
114
116
115
if ($ this ->app ['config ' ]['airtable.log_http ' ]) {
You can’t perform that action at this time.
0 commit comments