pulkitjalan / google-apiclient

Google api php client wrapper with Cloud Platform and Laravel support
MIT License
246 stars 75 forks source link

File does not exist #28

Closed tolborg closed 6 years ago

tolborg commented 6 years ago

I can't get my head around what I'm doing wrong here. I'm trying to connect using Service Account.

GOOGLE_APPLICATION_NAME= GOOGLE_CLIENT_ID= GOOGLE_CLIENT_SECRET= GOOGLE_REDIRECT= GOOGLE_DEVELOPER_KEY= GOOGLE_SERVICE_ENABLED=true GOOGLE_SERVICE_ACCOUNT_JSON_LOCATION=/resources/google/service-account.json

I get the error: InvalidArgumentException file does not exist

What am I doing wrong? (I have tried different variations of the path)

pulkitjalan commented 6 years ago

The path has to be an absolute path to the file on your server. So from your description, you file is in

/resources/...

And not

app_path()./resources/...

If it's in app path then resources, u will need to alter the config file.

On 10 Aug 2017, at 08:33, Anders Tolborg notifications@github.com wrote:

I can't get my head around what I'm doing wrong here. I'm trying to connect using Service Account.

GOOGLE_APPLICATION_NAME= GOOGLE_CLIENT_ID= GOOGLE_CLIENT_SECRET= GOOGLE_REDIRECT= GOOGLE_DEVELOPER_KEY= GOOGLE_SERVICE_ENABLED=true GOOGLE_SERVICE_ACCOUNT_JSON_LOCATION=/resources/google/service-account.json

I get the error: InvalidArgumentException file does not exist

What am I doing wrong? (I have tried different variations of the path)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

tolborg commented 6 years ago

Yes. I ended up doing this in google.php config file:

'file' => base_path() . '/' . env('GOOGLE_SERVICE_ACCOUNT_JSON_LOCATION', '')