Skip to content

Instantly share code, notes, and snippets.

@najathi
Last active March 24, 2023 04:12
Show Gist options
  • Save najathi/f9c6ef76edb3aa86c0cc3cabda9e028c to your computer and use it in GitHub Desktop.
Save najathi/f9c6ef76edb3aa86c0cc3cabda9e028c to your computer and use it in GitHub Desktop.
Laravel Google Config
<?php
return [
/*
|----------------------------------------------------------------------------
| Google application name
|----------------------------------------------------------------------------
*/
'application_name' => env('GOOGLE_APPLICATION_NAME', ''),
/*
|----------------------------------------------------------------------------
| Google OAuth 2.0 access
|----------------------------------------------------------------------------
|
| Keys for OAuth 2.0 access, see the API console at
| https://developers.google.com/console
|
*/
'client_id' => env('GOOGLE_CLIENT_ID', ''),
'client_secret' => env('GOOGLE_CLIENT_SECRET', ''),
'redirect_uri' => env('GOOGLE_REDIRECT', ''),
'scopes' => [\Google\Service\Sheets::DRIVE, \Google\Service\Sheets::SPREADSHEETS, \Google\Service\PeopleService::CONTACTS, \Google\Service\PeopleService::CONTACTS_READONLY, \Google\Service\PeopleService::CONTACTS_OTHER_READONLY, \Google\Service\PeopleService::USERINFO_PROFILE],
'access_type' => 'online',
'approval_prompt' => 'auto',
'prompt' => 'consent',
/*
|----------------------------------------------------------------------------
| Google developer key
|----------------------------------------------------------------------------
|
| Simple API access key, also from the API console. Ensure you get
| a Server key, and not a Browser key.
|
*/
'developer_key' => env('GOOGLE_DEVELOPER_KEY', ''),
/*
|----------------------------------------------------------------------------
| Google service account
|----------------------------------------------------------------------------
|
| Set the credentials JSON's location to use assert credentials, otherwise
| app engine or compute engine will be used.
|
*/
'service' => [
/*
| Enable service account auth or not.
*/
'enable' => env('GOOGLE_SERVICE_ENABLED', false),
/*
* Path to service account json file. You can also pass the credentials as an array
* instead of a file path.
*/
'file' => env('GOOGLE_SERVICE_ACCOUNT_JSON_LOCATION', ''),
],
/*
|----------------------------------------------------------------------------
| Additional config for the Google Client
|----------------------------------------------------------------------------
|
| Set any additional config variables supported by the Google Client
| Details can be found here:
| https://github.com/google/google-api-php-client/blob/master/src/Google/Client.php
|
| NOTE: If client id is specified here, it will get over written by the one above.
|
*/
'config' => [],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment