vrajroham / laravel-bitpay

Laravel BitPay Client | Accept Bitcoin(Ƀ) and Bitcoin Cash for your business with your Laravel application
MIT License
74 stars 34 forks source link

Cannot run createkeypair in Laravel 7 because Command::newLine() method does not exist #40

Closed Ririshi closed 2 years ago

Ririshi commented 2 years ago

The php artisan laravel-bitpay:createkeypair command is incompatible with Laravel 7, because it uses Command::newLine(), which did not exist in Laravel 7 (api reference), but was added in Laravel 8 (api reference). A simple solution would be to replace each instance of $this->newLine() with $this->output->newLine().

Error shown when trying to run the createkeypair command: Whoops! We have a problem: Method Vrajroham\LaravelBitpay\Console\CreateKeypairCommand::newLine does not exist.

One of our projects is still using Laravel 7, but we would like to use this package to integrate BitPay. Something minor like this console command is easy to fix and will allow us to create keys much more easily. Aside from that, may I suggest explicitly stating what the target Laravel versions are for the package (and perhaps each release)? Currently, it appears that the package is only built to support Laravel 8, but that is not stated anywhere.

vrajroham commented 2 years ago

@Ririshi Will check the issue as you mentioned and also thanks for pointing the problem re. what is the minimum Laravel version supported. We will test this and updated the requirements on readme.

vrajroham commented 2 years ago

@Ririshi To speedup the things if you think it’s easier then please test the suggested approach on Laravel 7 and send the PR.

Ririshi commented 2 years ago

Created a PR, as requested. This PR allows the command to be run on Laravel 7 (and lower versions, too, I presume). I did not test versions lower than 7, so no guarantees there. I think a separate issue would be appropriate to discuss overall package compatibility with lower Laravel versions.

I am yet to test the other functionalities on Laravel 7, so other issues might arise as I work to integrate BitPay into our application. Would further feedback (in a new issue), and perhaps PRs, to fully support Laravel 7 be appreciated? If I find any incompatibilities, that is.

vrajroham commented 2 years ago

@Ririshi The fix has been released in v5.0.1 by @alexstewartja. Your issue should have been resolved.

Ririshi commented 2 years ago

Thank you for addressing this so quickly! Using 5.0.1 from now on 😄