diff --git a/src/GoogleCloudStorageServiceProvider.php b/src/GoogleCloudStorageServiceProvider.php index c45aee0..bc8a262 100644 --- a/src/GoogleCloudStorageServiceProvider.php +++ b/src/GoogleCloudStorageServiceProvider.php @@ -85,19 +85,16 @@ public function boot() private function createClient($config) { $keyFile = Arr::get($config, 'key_file'); - if (is_string($keyFile)) { + if (is_array($keyFile)) { return new StorageClient([ 'projectId' => $config['project_id'], - 'keyFilePath' => $keyFile, + 'keyFile' => array_merge(["project_id" => $config['project_id']], $keyFile) ]); } - if (! is_array($keyFile)) { - $keyFile = []; - } return new StorageClient([ 'projectId' => $config['project_id'], - 'keyFile' => array_merge(["project_id" => $config['project_id']], $keyFile) + 'keyFilePath' => $keyFile ]); }