where do you use this config setting?
Mar 18, 2023
12
Level 1
artisan config:cache breaks app. It can't find credentials file referenced in .env
I have an environment variable for Google APIs credentials:
GOOGLE_APPLICATION_CREDENTIALS="/var/www/application_root/credentials/google/credentials.json"
In config/app.php, I have this:
'google_app_creds' => ENV('GOOGLE_APPLICATION_CREDENTIALS'),
Everything works great until I run php artisan config:cache. Then the application suddenly can't access the credentials json file and I get this error:
production.ERROR: Could not load the default credentials. Browse to https://developers.google.com/accounts/docs/application-default-credentials for more information
After I run php artisan config:clear, the error goes away and my google api content loads perfectly.
I checked in bootstrap/cache/config.php and the environment variable looks fine. Any ideas?
Please or to participate in this conversation.