Troubleshoot When Upgrade Laravel from 5.7 to 6.x — Error Implicit conversion of keys from strings is deprecated. Please use InMemory or LocalFileReference classes.

Why this Error Show?

Because JWT Token from tymon/jwt-auth package or Laravel Passport in Laravel version 6.x need lcobucci/jwt package to converting the token string.

Problem Solving

Run composer require lcobucci/jwt:3.3

Then try run project withphp artisan serve and test it again. Hope it solve your problem.

Big Note

  • lcobucci/jwt package version 3.3 is more stable than 3.4 for Laravel 6.x. Version 3.4 has show this problem too. So, if you already installed this package with 3.4 version, so you can downgrade it. composer require lcobucci/jwt:3.3 can resolve it.

References

https://stackoverflow.com/questions/65009120/implicit-conversion-of-keys-from-strings-is-deprecated-please-use-inmemory-or-l/65009290

--

--

Budiaramdhan Rindi

Currently work as Coder since 2011 and still have to learn. Dota 2 and Football Manager are the games I still play to stay fresh.