-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cached config #1
Comments
Hmm I wanted the AWS credentials to be handled by the underlying Can you trying this in S3File real quick: public function getS3Client(): S3Client
{
if (!$this->client) {
$this->client = resolve('aws')->createClient('s3', [
'region' => $this->getRegion(),
'version' => '2006-03-01'
]);
}
return $this->client;
} That should use the already configured AWS credentials, and merge the specific S3 region for this file (which may or may not match the default region configured). I'd prefer to use these default configured credentials rather than storing separate ones just for this package, if possible. |
If you relied on https://github.com/aws/aws-sdk-php-laravel then you could simply $s3 = App::make('aws')->createClient('s3'); or $s3 = AWS::createClient('s3'); Push handling it even further down the chain of command. |
I should really be using |
Thanks for your answers. I appreciate it. |
Excellent! |
Hi there! Still having config issues. it works locally, but not on my Laravel Forge managed server. I've goy aws-sdk-php-laravel installed and configured. Why not just add the key and secret to the config and use it to instantiate the client if it exists? It would simplify setup a lot. |
@ianrothmann I just pushed this change, can you try it out? I'm not in a position to test it at the moment. Update your composer.json to use |
@ambdisp and @ianrothmann This is now done. Version 1.5 caches AWS credentials in the package config file, and will work without the |
Dear @jszobody, It works like a charm. Thanks for your great work on this package! |
Thanks, it's very handy package.
I have just noticed, there is an issue with s3 when you cache the config
php artisan config:cache
Exception
Tested on clean Laravel 5.8 installation.
What worked for me:
config.php
S3File.php
Hope this helps.
The text was updated successfully, but these errors were encountered: