Closed RonMelkhior closed 7 years ago
I have also encountered this issue tonight.
After reading the documentation and testing you can fix this by doing the following:
1. Open up \vendor\invisnik\laravel-steam-auth\src\SteamServiceProvider,php
2. Change the following in the register() function
$this->app['steamauth'] = $this->app->share( function () { return new SteamAuth(); } );
to
$this->app->singleton('SteamAuth', function($app) { return new SteamAuth($app['SteamAuth']); });
directly modifying vendor packages is a bad habit. seeing as you should not upload the vendor directory to your VCS repo.
Also no need for the constructor argument in your code. See my PR for a good example.
On Jan 25, 2017 12:18 AM, "Ben" notifications@github.com wrote:
I have also encountered this issue tonight.
After reading the documentation and testing you can fix this by doing the following:
1. Open up \vendor\invisnik\laravel-steam-auth\src\SteamServiceProvider,php
2. Change the following in the register() function
$this->app['steamauth'] = $this->app->share( function () { return new SteamAuth(); } );
to
$this->app->singleton('SteamAuth', function($app) { return new SteamAuth($app['SteamAuth']); });
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/invisnik/laravel-steam-auth/issues/43#issuecomment-274957539, or mute the thread https://github.com/notifications/unsubscribe-auth/AA-HeZ6LbNB23nNiyBL71LP6yQoumBOeks5rVni4gaJpZM4LsxNk .
I am suggesting this is what needs to be changed in the package, of course editing the vendor is not suggested but until the package is updated this is a way of fixing it.
And yes I forgot to remove that due to using an example from the Laravel Docs.
The PR was merged and a new release is out (v2.3.2).
In Laravel 5.4, the
share
method was deleted and it is mentioned libraries should usesingeleton
.Code in question
Docs:
https://laravel.com/docs/5.4/upgrade#upgrade-5.4.0
EDIT: I have submitted a PR (#44) to fix this.