@@ -37,7 +37,6 @@ public function __construct($app)
37
37
* Get a airtable table instance.
38
38
*
39
39
* @param string $table
40
- * @return \Airtable\Table
41
40
*/
42
41
public function table (string $ table )
43
42
{
@@ -56,7 +55,7 @@ protected function configuration($name)
56
55
{
57
56
$ name = $ name ?: $ this ->getDefaultTable ();
58
57
59
- // To get the aritable table configuration, we will just pull each of the
58
+ // To get the airtable table configuration, we will just pull each of the
60
59
// connection configurations and get the configurations for the given name.
61
60
// If the configuration doesn't exist, we'll throw an exception and bail.
62
61
$ tables = $ this ->app ['config ' ]['airtable.tables ' ];
@@ -112,18 +111,12 @@ protected function createAirtable($table, $table_base = false)
112
111
$ base = $ table_base ?: $ this ->app ['config ' ]['airtable.base ' ];
113
112
$ access_token = $ this ->app ['config ' ]['airtable.key ' ];
114
113
115
- if ($ this ->app ['config ' ]['airtable.log_http ' ]) {
116
- $ httpLogFormat = $ this ->app ['config ' ]['airtable.log_http_format ' ];
117
- } else {
118
- $ httpLogFormat = null ;
119
- }
120
-
121
114
$ airtableTypeCast = $ this ->app ['config ' ]['airtable.typecast ' ];
122
115
$ delay = $ this ->app ['config ' ]['airtable.delay_between_requests ' ];
123
116
124
- $ client = new AirtableApiClient ($ base , $ table , $ access_token , $ httpLogFormat , null , $ airtableTypeCast , $ delay );
117
+ $ client = new AirtableApiClient ($ base , $ table , $ access_token , null , $ airtableTypeCast , $ delay );
125
118
126
- return new Airtable ($ client, $ table );
119
+ return new Airtable ($ client );
127
120
}
128
121
129
122
/**
@@ -146,6 +139,9 @@ protected function getConfig($name)
146
139
*/
147
140
public function __call ($ method , $ parameters )
148
141
{
149
- return $ this ->table ()->$ method (...$ parameters );
142
+ $ defaultConfig = $ this ->app ['config ' ]['airtable.default ' ];
143
+ $ defaultTable = $ this ->app ['config ' ]["airtable.tables. {$ defaultConfig }" ]['name ' ];
144
+
145
+ return $ this ->table ($ defaultTable )->$ method (...$ parameters );
150
146
}
151
147
}
0 commit comments