kofi1995 / laravel-sagepay

Sagepay Integration for Laravel 5.x
10 stars 9 forks source link

Call to undefined method Illuminate\Foundation\Application::share() #10

Open xron89 opened 6 years ago

xron89 commented 6 years ago

Hi, followed your steps after running the following command;

php artisan vendor:publish --provider="Kofikwarteng\LaravelSagepay\SagepayServiceProvider"

I get the following error; Call to undefined method Illuminate\Foundation\Application::share()

I assume this hasn't been updated for Laravel versions past 5.4

andylord56 commented 6 years ago

Add this to SagePayServiceProvider.php in the register part:

$this->app->singleton('laravelsagepay', function ($app) { return new SagePay; }); remove old: $this->app['laravelsagepay'] = $this->app->share(function($app) { return new SagePay; }); Copy from Config file to App/config away you go.

sheixt commented 5 years ago

Looks like this has been long standing with a working fix in the issue... Any way we can get a PR so the package is updated