Skip to content

Commit

Permalink
Avoid using singleton sms manager which holds previous connection state
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshgurusamy committed Dec 10, 2018
1 parent a20f67d commit 153cdc0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Providers/SmsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function boot()
*/
public function register()
{
$this->app->singleton('sms', function ($app) {
$this->app->bind('sms', function ($app) {
return new SmsManager($app['config']['sms']);
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/SmsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ public function dispatch(): ResponseInterface
throw MessageException::notFound();
}

$this->connection = $this->connection ?? $this->resolveConnection($this->device);
$connection = $this->connection ?? $this->resolveConnection($this->device);

return $this->getAdapter($this->connection)->send($this->device, $this->message);
return $this->getAdapter($connection)->send($this->device, $this->message);
}

/**
Expand Down

0 comments on commit 153cdc0

Please sign in to comment.