Welcome Guest, Not a member yet? Register   Sign In
Google API php client
#1

(This post was last modified: 05-01-2020, 11:28 AM by php_rocs.)

hi, I am trying to use the google client api. Following the instructions of developers.google.com/sheets/api/quickstart/php, I can't get to instantiate the client object.

I put this code in my controller:
PHP Code:
<?php namespace App\Controllers;

require_once   (__DIR__ './../ThirdParty/googleApi/vendor/autoload.php');

class 
GoogleSheetData extends BaseController
{
    public function index()
    {
        putenv('GOOGLE_APPLICATION_CREDENTIALS='.(__DIR__ './../ThirdParty/xxxxxx.json'));
        $client = new Google_Client();
.
.


but I get the error:
Class 'App\Controllers\Google_Client' not found

I appreciate any help, thanks
code live
Reply


Messages In This Thread
Google API php client - by ivan1900 - 05-01-2020, 11:01 AM
RE: Google API php client - by jreklund - 05-01-2020, 11:42 AM
RE: Google API php client - by ivan1900 - 05-02-2020, 01:41 AM
RE: Google API php client - by jreklund - 05-02-2020, 01:48 AM
RE: Google API php client - by ivan1900 - 05-02-2020, 09:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB