aws / aws-sdk-php-laravel

A Laravel 5+ (and 4) service provider for the AWS SDK for PHP
http://aws.amazon.com/sdkforphp/
Apache License 2.0
1.64k stars 242 forks source link

Error Unresolvable dependency resolving [Parameter #0 [ <required> array $args ]] in class Aws\AwsClient #201

Closed leonildojunior closed 1 year ago

leonildojunior commented 3 years ago

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug After performing the settings indicated in the documentation, I tried to use it in a service, according to the code below, and I got the error: Unresolvable dependency resolving [Parameter #0 [ <required> array $args ]] in class Aws\AwsClient

my code

namespace App\Services\Xpi;

use Aws\Exception\AwsException;
use Aws\SecretsManager\SecretsManagerClient;
...
  $clientAWS = new awsSecretManage([
             'profile' => 'default',
             'version' => 'latest',
             'region' => env('AWS_REGION'),
         ]);

         $token_development = $clientAWS->getSecretValue([
             'SecretId' => 'bff-dsv',
         ]);

And on the controller

use App\Services\Xpi\Client;

$clientXP = $clientXP->getClient('xxxxxx');

Version of AWS SDK for PHP?


Version of AWS Service Provider for Laravel?

Version of Laravel (php artisan --version)? 3.185.2

Version of PHP (php -v)? 7.3.22

Screenshots

Captura de tela 2021-06-27 184826
matiaslauriti commented 2 years ago

You are showing 2 different issues here, one is Unresolvable dependency and other one is Target class does not exist..

yenfryherrerafeliz commented 1 year ago

Hi @leonildojunior, thanks for opening this issue. I am not able to reproduce the reported behavior, and some details are missing to understand better your implementation. For example, I do not know what the following code means:

use App\Services\Xpi\Client;

$clientXP = $clientXP->getClient('xxxxxx');

For what I see, you are trying to call a method from the same variable that you just declared.

So, could you please let me know if this is a persistent issue for you, if so, could you please provide more clear and specific details about how to reproduce the issue?

For my reproduction I followed the next steps:

github-actions[bot] commented 1 year ago

This issue has not recieved a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.

FiodorCroitor commented 1 month ago

Lol kek cheburek