Is it safe/right to use an older version of Google api PHP client library (2.8.3) for Google Wallet api integration - laravel-4

I have an old/big project that is based on Laravel 4.2.
In the wallet samples provided by Google, https://github.com/google-pay/wallet-samples/tree/main/php I can see that the version used in the composer is
"google/apiclient": "^2.12". However, google/apiclient version 2.12 is incompatible with Laravel 4.2 because of the requirement of "phpseclib/phpseclib": "~2.0||^3.0.2" (Laravel 4.2 is only compatible with 0.3.*).
I have therefore throught that I can simply use version https://github.com/googleapis/google-api-php-client/tree/v2.8.3 of the library which supports "phpseclib/phpseclib": "~0.3.10||~2.0".
Is it OK to use version 2.8.3 for integration? What are the risks associated with this decision?
Thanks

Related

Cannot generate ApiDoc assets in Laravel 9

I'm new to laravel and I'm having some issues in generating an api documentation (SwaggerAPI, OpenAPI, Postman, whatever it works). I am upgrading a laravel application and got stuck got a few things I need to do solve with the latest version (9.x)
I've followed the steps installing the most popular libraries but I failed getting and error because of lumen is a higher version that is not supported. I also cannot run artistan vendor because it seems not working in Laravel 9 neither.
I've tested the following libraries and they didn't run in Laravel 9:
L5 Swagger
laravel-apidoc-generator
Laravelista and Vendor
Can anyone help me?

Error, Lcobucci\JWT\Signer\InvalidKeyProvided: It was not possible to parse your key

I hope you are doing fine. I was working on Oauth passport laravel, it was working fine on my previouse machine but i had to switch machines.My new machine has php 8 and my laravel project is of 7.30.0 version and my lcobucci/jwt version is 3.3.3. When i try to hit register route on postman i get the following error
Lcobucci\JWT\Signer\InvalidKeyProvided: It was not possible to parse your key, reason: in file C:\Users\user\Documents\GitHub\myproject\vendor\lcobucci\jwt\src\Signer\InvalidKeyProvided.php on line 17
As you can see on https://packagist.org/packages/lcobucci/jwt#3.3.3, that JWT package is officially not compatible with PHP 8. You should upgrade it to a compatible version (at least v4), or downgrade your PHP version to v7
This is coming super late.
For anyone still experiencing this, just generate a new jwt secret.
This command will generate a new key that fits the new requirement
php artisan jwt:secret

cartalyst/converter on laravel 5.6

I'm trying to setup cartalyst/converter on laravel 5.6 Their link is here: https://cartalyst.com/manual/converter/2.0
I'm following official instruction and getting
Call to undefined method Illuminate\Foundation\Application::share()
I feel like Cartalyst\Converter\Laravel\ConverterServiceProvider is not livable.
How else can I install it?
They have "Native" way, but in laravel case where would I put their "native" code?
Illuminate\Foundation\Application::share() method was removed in Laravel 5.4, in favor of the singleton() method.
Do you need to use v2.0 of this package? 3.0 was released specifically to stay up-to-date with Laravel. I suggest using the most recent version instead of the 2.0 branch.
https://cartalyst.com/manual/converter/3.0

Laravel Scout with AWS ElasticSearch added Basic Auth Header

So I am using Laravel Scout in a 5.3 app to connect to AWS ElasticSearch. Everything is connected except when I try to connect to ElasticSearch an extra Basic Auth header is being added even though I am specifying an IAM credentials. Specifically, the error is reads: [Elasticsearch\Common\Exceptions\Forbidden403Exception]
{"message":"'NzA3OTQxMjg4NDc4OkFLSUFJV1gzNUhDMzIyTVczUVpB' not a valid key=value pair (missing equal-sign) in Authorization header: 'Basic NzA3OTQxMjg4NDc4OkFLSUFJV1gzNUhDMzIyTVczUVpB'."}
One side note is I had to downgrade to Laravel Scout 1.1.12 because the elasticsearch driver could not be found by version 2.0, it seems like Taylor is working on this. However, my elasticsearch/elasticsearch package is ^5.0.
This is apparently an ElasticSearch issue with the driver, even using the elasticsearch/elasticsearch package. Switching to Algolia solved the use case and had no issues.

Laravel 5 new declaration causing an error

I am using Laravel 5.0.3 for one project few days ago. Now I create another project using the same version but I noticed the declaration (or whatever you call it) has changed from something like:
'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode'
to
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class
and this is actually causing an FatalError. My idea is that this is something to do with the php version, but I don't want to update just yet.
What options do I have to sort this issue?
It's called class name resolution and a new feature that is implemented in PHP 5.5. The reason that you are getting that error is your PHP version of your PHP interpreter should be lower than PHP 5.5. Don't forget that Laravel 5.1 LTS package requires PHP 5.5.9 version minimum. You can keep your old configuration as 'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode' instead of \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class. But first, you should also downgrade your Laravel version from 5.1 to 5. Better and recommended is to upgrade your PHP version as PHP 5.4 will be soon deprecated.

Resources