PHP code example of karim-tao / airtable-laravel

1. Go to this page and download the library: Download karim-tao/airtable-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

karim-tao / airtable-laravel example snippets


use Airtable\Client\AirtableClient;
use Airtable\Laravel\Http\LaravelHttpClient;

$airtable = AirtableClient::factory()
    ->withClientCredentials(config('airtable.auth.client_id'), config('airtable.auth.client_secret'))
    ->withToken($accessToken, $expiresAt, $refreshToken)
    ->withHttpClient(new LaravelHttpClient)
    ->make();

$user = $airtable->users()->me();

Http::fake([
    'api.airtable.com/v0/meta/whoami' => Http::response(['id' => 'usr123', 'email' => '[email protected]']),
]);
bash
php artisan vendor:publish --tag=airtable-config