PHP code example of arindam / gsheet-appscript

1. Go to this page and download the library: Download arindam/gsheet-appscript 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/ */

    

arindam / gsheet-appscript example snippets


Arindam\GsheetAppScript\GsheetAppScriptServiceProvider::class,

'GsheetAppScript' => Arindam\GsheetAppScript\Gsheet\GsheetAppScriptClassFacade::class,

php artisan vendor:publish --provider="Arindam\GsheetAppScript\GsheetAppScriptServiceProvider" --force
-OR-
php artisan vendor:publish --tag="gsheet-appscript:config"

GSHEET_APPSCRIPT_API_URL=_YOUR_APP_SCRIPT_API_URL_

use GsheetAppScript;

GsheetAppScript::allRecords(); //get all records from google sheet

GsheetAppScript::addRow(['Text1', 'Text2', 'Text3' ...]); //add row in the google sheet

GsheetAppScript::setHeading(['Heading1', 'Heading2', 'Heading3' ...]); //set or edit heading in the google sheet

GsheetAppScript::editRow(['id' => 4, 'Text1', 'Text2', 'Text3' ...]); //edit data in the google sheet, just pass the row number as id with data

GsheetAppScript::removeRow(['id' => 4]); //remove row from google sheet, just pass the row number

GsheetAppScript::clearSheet(); //delete all records in google sheet

Ex: http://your-website/onex/gsheet

Ex: http://localhost:8000/onex/gsheet

/** If you want to disable the route or this feature, then make it false */
'is_route_enabled' => true,

/** If you want to change the route prefix */
'route_prefix' => 'onex',

/** If you want to change the route name or path */
'route_name' => 'gsheet',

/** If you want to change the page heading */
'page_heading' => 'Google Sheet',

/** If you want to enable the securiry for access the google sheet information
 *  Then make it ('is_enabled') true and also you can set login-id and password through .env
 */
'authentication' => [
    'is_enabled' => env('GSHEET_APPSCRIPT_AUTH_ENABLED', false),
    'login_id' => env('GSHEET_APPSCRIPT_LOGIN_ID', 'onexadmin'),
    'password' => env('GSHEET_APPSCRIPT_LOGIN_PASSWORD', 'onexpassword')
]