When I login then error will be ocuurred "It was not possible to parse your key, reason". (Laravel api) - laravel

{"message": "It was not possible to parse your key, reason: "}
I also tried composer update command and composer require laravel/passport and php artisan passport:install.
But the same error is still occurring. Please suggest me what is the solution for this error.

If I changed the version of PHP and it's work.

Related

ReflectionClass $concrete is empty or null after upgrade to php8.0.8

Running php artisan passport:install after upgrading from php7.4 to php8.1 throws:
Class "" not found error
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?
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.
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.

Laravel 8 + backpack throws error on "php artisan backpack:crud User"

I installed a fresh install or laravel "^8.75" and backpack "^5.3" and when I run "php artisan backpack:crud User" I get this error:
BadMethodCallException
Method Illuminate\Support\Stringable::lcfirst does not exist.
Does anyone know what the issue might be ? I cannot find a solution online.
I've just submitted the PR to fix this, we are using lcfirst as part of Laravel Str::class and that's not available in L9, so the error raises.
It should be fixed, merged and tagged during today.
You can follow the PR here: https://github.com/Laravel-Backpack/Generators/pull/149
Cheers

Error: In laravel 8 with passport 10 after running composer update command

I have an error while creating passport token in laravel 8 with passport package 10. Everything is working properly before running composer update command. When I run the composer update command I got this error:-
message: "Method Laravel\Passport\Bridge\AccessToken::__toString() must not throw an
exception, caught ErrorException: Using integers for registered date claims is
deprecated, please use DateTimeImmutable objects instead."
exception: "Symfony\Component\ErrorHandler\Error\FatalError"
Please help while resolving this error. Any help would be appreciable.
Current solution is downgrade lcobucci/jwt package.
composer require lcobucci/jwt:3.3.3
Also you can check this https://github.com/laravel/passport/issues/1380

Laravel - compact(): Undefined variable: operator in Builder.php

I have PHP version-7.3 installed in my system and Laravel-5.8. When I tried to rub composer install or composer update on an old Project with Laravel-5.4 and PHP Version-5.6.4, I got this error shown below:
In Builder.php line 1229:
compact(): Undefined variable: operator
Script php artisan optimize handling the post-install-cmd event returned with error code 1
Then, when I tried to run the application, I got this error page as shown on the screen:
I tried to run:
php artisan cache:clear
and
composer update
but the problem is still there.
How do I get it resolved?
Thank you.
It looks like this issue was fixed in Laravel 5.5 according to this post: https://github.com/laravel/framework/issues/26936#issuecomment-449479336
Since Laravel 5.4 is no longer supported, your best option might be to upgrade. You can find a list of the currently supported versions here: https://laravel.com/docs/releases
The minimal upgrade that should still fix the error would be 5.4 to 5.5. The instructions can be found here: https://laravel.com/docs/5.5/upgrade#upgrade-5.5.0 (please note that support for 5.5 has also ended, but it might still fix your bug). This would also require you to switch the project to PHP 7.0.0 or greater.
If:
You can't upgrade for whatever business/team related reason and
Are sure that the Homestead box is running the correct version of PHP (7.2 or lower based on the answer given here) and yet
are still getting this error,
explicitly define the PHP version on the Homestead.yaml file. This should be done on the sites property as such (each is a new line, of course):
map: test.appp
/home/vagrant/code/test/public
php: "7.1"

Composer error installing laravel-cors

I tried to install laravel-cors
composer require barryvdh/laravel-cors
It installed successfully or so I thought, but then when I went to publish the config I get this error:
[RuntimeException]
Error Output: PHP Fatal error: Cannot redeclare Composer\Autoload\includeFile() (previously declared in /www/vendor/composer/ClassLoader.php:410) in /www/config/vendor/composer/ClassLoader.php on line 413
I have tried removing laravel-cors and I still get this error. I have dumped autoload as well. What am I missing?
Larval 5.2 | PHP 5.6.17
I figured it out. When i typed
composer require barryvdh/laravel-cors
i was in a sub directory. so composer then installed it and the dependencies in a sub directory which is why i was getting that error. If you look closely you can see that it was installing in config
/www/config/vendor/composer/ClassLoader.php:413
/www/vendor/composer/ClassLoader.php:410
Just needed to pay better attention to detail.

Resources