yaza-putu / laravel-google-drive-storage

Laravel Google Drive Storage, You can store file like S3 AWS in laravel , this package allow to store file to google drive
MIT License
116 stars 29 forks source link

Remove config from provider to make config:cache work #13

Closed SPQRBrutus closed 10 months ago

SPQRBrutus commented 11 months ago

When I used php artisan config:cache command all variables was null because you can't read from .env in your provider but only config files. https://laracasts.com/discuss/channels/laravel/configcache-makes-variables-in-env-null

ades4827 commented 9 months ago

The problem isn't solved for me.

When I type the artisan shell command "optimize:clear" and then "optimize" (activate caches) the following error appears: "refresh token must be passed in or set as part of setAccessToken".

Looking in the code (vendor/yaza/laravel-google-drive-storage/src/LaravelGoogleDriveStorageServiceProvider.php:34), access to the env is done via the "env('GOOGLE_DRIVE_REFRESH_TOKEN')" function, not the cached config: "config('filesystems.disks.google.refreshToken', env('GOOGLE_DRIVE_REFRESH_TOKEN'));"