Skip to content

Commit 2db080b

Browse files
authored
Merge pull request #262 from imdhemy/google-credentials-path
[1.x] Fetch google credentials file from the base path
2 parents ef5cfd9 + b9725b2 commit 2db080b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

config/liap.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
| @see https://imdhemy.com/laravel-iap-docs/docs/credentials/google-play
4040
|
4141
*/
42-
'google_application_credentials' => env('GOOGLE_APPLICATION_CREDENTIALS', null),
42+
'google_application_credentials' => base_path(env('GOOGLE_APPLICATION_CREDENTIALS')),
4343

4444
/*
4545
|--------------------------------------------------------------------------

src/ServiceProviders/LiapServiceProvider.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ private function registerConfig(): void
117117
$this->mergeConfigFrom(self::CONFIG_PATH, self::CONFIG_KEY);
118118

119119
$googleCredentials = config(self::CONFIG_KEY . '.google_application_credentials');
120-
if ($googleCredentials !== null) {
120+
121+
if ($googleCredentials !== null && ! is_dir($googleCredentials)) {
121122
if (! file_exists($googleCredentials)) {
122123
throw new RuntimeException("Google Application Credentials file not found at $googleCredentials");
123124
}

0 commit comments

Comments
 (0)