sfelix-martins / passport-multiauth

Add support to multi-authentication to Laravel Passport
MIT License
288 stars 51 forks source link

Class 'Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory' not found #127

Closed YassineChe closed 4 years ago

YassineChe commented 4 years ago

Hello everyone.

I getting this error

message: "Class 'Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory' not found",…} message: "Class 'Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory' not found" exception: "Error" file: "/app/vendor/smartins/passport-multiauth/src/Facades/ServerRequest.php" line: 17 trace: [,…]

This is my Composer

"require": { "php": "^7.2.5", "fideloper/proxy": "^4.2", "fruitcake/laravel-cors": "^1.0", "guzzlehttp/guzzle": "^6.5", "laravel/framework": "^7.0", "laravel/tinker": "^2.0", "laravel/ui": "^2.0", "smartins/passport-multiauth": "^6.0", "symfony/psr-http-message-bridge": "^2.0" }

NB: When i put this file (DiactorosFactory.php) in the directory from my older laravel project it's work perfectly.

Any suggestions guys ?

ZedanLab commented 4 years ago

I got the same error, after digging out the error I found the package symfony/psr-http-message-bridge in last release they removed Diactoros Factory.

2.0.0 (2020-01-02) Remove DiactorosFactory check the CHANGELOG

Also laravel/passport requires symfony/psr-http-message-bridge ^2.0 composer.json

The solution till this package support symfony/psr-http-message-bridge ^2.0: Add in your project composer.json file: "symfony/psr-http-message-bridge": "^1.1" That's work for me.

YassineChe commented 4 years ago

Hello @ZedanLab,

I tryied before the older version of symfony/psr-http-message-bridge it worked fine.

The problem is that i was working with the older version of passport-multiauth, that requires DiactorosFactory class, but when upgraded to lastest version the issue disappeared.

In case you want to work with version 1.1 of PSR isn't practical, may occur some issues in near future with specific packages, i recommending you to check your packages version.

This guy here #1028 was so helpful. Thank you.