PHP code example of nonsapiens / bigquery-model-sync

1. Go to this page and download the library: Download nonsapiens/bigquery-model-sync 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/ */

    

nonsapiens / bigquery-model-sync example snippets


namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Nonsapiens\BigqueryModelSync\Traits\SyncsToBigQuery;

class User extends Model
{
    use SyncsToBigQuery;
}
bash
php artisan vendor:publish --tag="bigquery-model-sync-config"
php artisan vendor:publish --tag="bigquery-model-sync-migrations"
bash
php artisan migrate
bash
php artisan make:bigquery-table --class="App\Models\User"
bash
php artisan make:bigquery-model-migration --class="App\Models\User"
php artisan migrate
bash
php artisan queue:work
bash
php artisan bigquery:set-model
bash
php artisan make:bigquery-table --class="App\Models\User"
bash
php artisan make:bigquery-model-migration --class="App\Models\User"
bash
php artisan bigquery:sync --class="App\Models\User" [options]