dusterio / lumen-passport

Making Laravel Passport work with Lumen
MIT License
654 stars 139 forks source link

Got internal server error Class 'Zend\Diactoros\Response' not found #144

Closed tomg65 closed 3 years ago

tomg65 commented 3 years ago

Hi,

in a new lumen 8 project i got this error on POST to /oauth/token:

Class 'Zend\Diactoros\Response' not found

in vendor/dusterio/lumen-passport/src/Http/Controllers/AccessTokenController.php (line 34)

.... use Zend\Diactoros\Response as Psr7Response; .... .... return $this->server->respondToAccessTokenRequest($request, new Psr7Response);

Best Thomas

gonzariosm commented 3 years ago

zendframework/zend-diactoros is abandoned, you can change to laminas/laminas-diactoros

If you need a simple solution, you can follow this steps.

  1. in root project folder exec command

composer require laminas/laminas-diactoros

  1. Edit file vendor/dusterio/lumen-passport/src/Http/Controllers/AccessTokenController.php

search use Zend\Diactoros\Response as Psr7Response;

replace use Laminas\Diactoros\Response as Psr7Response;

dusterio commented 3 years ago

@gonzariosm what about backward compatibility? will this work with older versions?

gonzariosm commented 3 years ago

sorry @dusterio i do not know because only test in Lumen 8.

tailastra commented 3 years ago

works fine for me, thanks @gonzariosm

dusterio commented 3 years ago

@gonzariosm ok I created a new version 0.3.1 just to be safe, thanks for the report

tomg65 commented 3 years ago

@gonzariosm ok I created a new version 0.3.1 just to be safe, thanks for the report

perfect - thank you very much