<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
amazingbv / laravel-google-sheets-database-driver example snippets
use Illuminate\Support\Facades\DB;
$users = DB::connection('google-sheets')
->table('users')
->where('active', true)
->orderBy('name')
->get();
class Contact extends Model
{
protected $connection = 'google-sheets';
protected $table = 'contacts';
protected $guarded = [];
}
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
Schema::connection('google-sheets')->create('products', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->integer('price');
$table->timestamps();
});