PHP client for Google Sheets.
This library provides a set of class and methods to work with Google Api Client for PHP google/apiclient.
- php >= 5.6
composer require reverse/g-sheets:"dev-master"
To work with Google Sheets have to init Client
and Spreadsheets
classes.
$googleClient = new \Google_Client($config);
$client = new Client($googleClient);
spreadsheets = new Spreadsheets($client, 'sheetid');
$value = new Value('a', 'b', 'c');
$spreadsheets->append($value, 'Sheet1');
$value = new Value('a', 'b', 'c');
$spreadsheets->update($value, 'Sheet1');
$spreadsheets->clear('Sheet1!1:2');
// This get return Sheet1's first column
$spreadsheets->get('Sheet1!1:1');
// This call delete first row of sheets specified
// sheetId is gid not sheet's name
$delete->execute(Delete::DIMENSION_ROWS, '12675hakas', 0, 1);