Skip to content

Commit 153cdc0

Browse files
Avoid using singleton sms manager which holds previous connection state
1 parent a20f67d commit 153cdc0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Providers/SmsServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function boot()
3333
*/
3434
public function register()
3535
{
36-
$this->app->singleton('sms', function ($app) {
36+
$this->app->bind('sms', function ($app) {
3737
return new SmsManager($app['config']['sms']);
3838
});
3939
}

src/SmsManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ public function dispatch(): ResponseInterface
112112
throw MessageException::notFound();
113113
}
114114

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

117-
return $this->getAdapter($this->connection)->send($this->device, $this->message);
117+
return $this->getAdapter($connection)->send($this->device, $this->message);
118118
}
119119

120120
/**

0 commit comments

Comments
 (0)