0

Running php artisan passport:install after upgrading from php7.4 to php8.1 throws:

Class "" not found error

code

I have tried to bypass this error by checking for isClass before passing $concrete value to ReflectionClass method in Container.php, but this later lead to:

Type error: Laravel\Passport\Console\ClientCommand::handle(): Argument #1 ($clients) must be of type Laravel\Passport\ClientRepository, null given

Where is this empty value comes from when run php artisan passport:install? Where is the ReflectionClass get the list of class to check from?

matiaslauriti
  • 7,065
  • 4
  • 31
  • 43
  • 2
    Do not modify ever a vendor file/folder, that is core code where you don't have control over, you are just going to modify core code and then forget and your code in production is going to blow up when you do a release! Related to the error, can you post a longer stack trace? – matiaslauriti Jan 31 '23 at 00:45

2 Answers2

0

Never change any code of the vendor because after a composer update all your codes will disappear and rollback to the original.

When you upgrade your Laravel version, you need to do

composer install
composer dump-autoload -o

to make sure all packages are consistent with your new version.

zanderwar
  • 3,440
  • 3
  • 28
  • 46
M a m a D
  • 1,938
  • 2
  • 30
  • 61
0

Thank you matiaslauriti and MamaD. I found the update for the Container package here: https://github.com/illuminate/container. Hope this can help someone else.