14

When posting form I am getting this exception

Unresolvable dependency resolving [Parameter #0 [ $method ]] in class GuzzleHttp\Psr7\Request

Searched and tried many ways to solve this but no progress. Seems that my problem is same as this issue

Any positive response will be appreciated. Thank You.

shaedrich
  • 5,457
  • 3
  • 26
  • 42
Ansib Raza
  • 388
  • 2
  • 3
  • 11

3 Answers3

59

I had the same error and found solution by removing following line.

use GuzzleHttp\Psr7\Request;

and use following Request class instead.

use Illuminate\Http\Request;

I hope it will help you too.

shaedrich
  • 5,457
  • 3
  • 26
  • 42
Nirav Sheth
  • 606
  • 6
  • 3
9

I have also faced same error like in Laravel

Unresolvable dependency resolving [Parameter #0 [ $method ]] in class GuzzleHttp\Psr7\Request.

But when I changed

use GuzzleHttp\Psr7\Request; 

to

use Illuminate\Http\Request;

then the problem was gone.

β.εηοιτ.βε
  • 33,893
  • 13
  • 69
  • 83
Saiful Islam
  • 131
  • 1
  • 2
8

I have supplied parameters to _contruct function which do not have default value.

protected $method;

public function __construct($method){
}

I changed it to

protected $method;

public function __construct($method=''){
}
  • Just wanted to log in to say thankyou, switched over my social media app to upload files right from the device to S3, however in order to create thumbnails for videos I am using FFMPeg and Kernal\Commands. Had to update my composer to utilize S3 sdk and it started causing issues – kuramura143 Aug 18 '23 at 21:43