Replicating claims as headers is deprecated and will removed from v4.0 - Laravel Passport Problem in lcobucci/jwt package

Solution 1:

This issue has forced me to know that laravel/passport uses thephpleague/oauth2-server and thephpleague/oauth2-server uses lcobucci/jwt "3.3.3".

composer require lcobucci/jwt=3.3.3

I wouldn't have bothered to check this if everything worked fine today after I ran composer update on my app.

Solution 2:

I'm deeply sorry for causing confusion or issues. Please check https://github.com/lcobucci/jwt/issues/550#issuecomment-733557709 for my full explanation on why this approach was taken and why it isn't considered a BC-break in my PoV.

Solution 3:

I know how people love a copy and paste answer. I fixed this by added this code to app/Providers/AppServiceProvider.php in the boot method

if (config('app.debug')) {
    error_reporting(E_ALL & ~E_USER_DEPRECATED);
} else {
    error_reporting(0);
}

This is what the author of suggested. See @Luís Cobucci answer. Or look here: https://github.com/lcobucci/jwt/issues/550#issuecomment-733557709

If you do @Ahmed Nasser method of requiring an old version then you will probably have issues in the future.