Skip to content

Commit 455f4c9

Browse files
committed
Update service-account.md
1 parent d2e720e commit 455f4c9

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

docs/service-account.md

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -213,45 +213,3 @@ GOOGLE_SERVICE_ACCOUNT_JSON_LOCATION='{"type": "service_account", "project_id":
213213
```
214214

215215
This approach eliminates the need to store a separate JSON file and makes deployment easier, especially in containerized environments or CI/CD pipelines.
216-
217-
### Using Credentials Array Instead of File
218-
219-
You can also pass credentials as an array instead of a file path:
220-
221-
```php
222-
// config/google.php
223-
'service' => [
224-
'enable' => true,
225-
'file' => [
226-
'type' => 'service_account',
227-
'project_id' => env('GOOGLE_PROJECT_ID'),
228-
'private_key_id' => env('GOOGLE_PRIVATE_KEY_ID'),
229-
'private_key' => env('GOOGLE_PRIVATE_KEY'),
230-
'client_email' => env('GOOGLE_CLIENT_EMAIL'),
231-
'client_id' => env('GOOGLE_CLIENT_ID'),
232-
'auth_uri' => 'https://accounts.google.com/o/oauth2/auth',
233-
'token_uri' => 'https://oauth2.googleapis.com/token',
234-
'auth_provider_x509_cert_url' => 'https://www.googleapis.com/oauth2/v1/certs',
235-
'client_x509_cert_url' => env('GOOGLE_CLIENT_CERT_URL'),
236-
],
237-
],
238-
```
239-
240-
### Multiple Service Accounts
241-
242-
For applications that need to access different sets of spreadsheets, you can configure multiple service accounts and switch between them:
243-
244-
```php
245-
// Create a separate client for a different service account
246-
$client = new \Revolution\Google\Client\GoogleApiClient([
247-
'service' => [
248-
'enable' => true,
249-
'file' => storage_path('app/another-service-account.json'),
250-
],
251-
]);
252-
253-
$sheets = new \Revolution\Google\Sheets\SheetsClient();
254-
$sheets->setService($client->make('sheets'));
255-
```
256-
257-
This setup allows you to manage different authentication contexts for different parts of your application.

0 commit comments

Comments
 (0)