Skip to content

Commit a45d5be

Browse files
authored
Merge pull request #35 from ChristopherCarranza/feature/SeparateAccountSID
Updated config names to match TwilioService. Added ability to explici…
2 parents aacc86e + cd6fa05 commit a45d5be

File tree

3 files changed

+24
-13
lines changed

3 files changed

+24
-13
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ Add your Twilio Account SID, Auth Token, and From Number (optional) to your `con
4949
// config/services.php
5050
...
5151
'twilio' => [
52-
'account_sid' => env('TWILIO_ACCOUNT_SID'),
53-
'auth_token' => env('TWILIO_AUTH_TOKEN'),
52+
'username' => env('TWILIO_USERNAME'),
53+
'password' => env('TWILIO_PASSWORD'),
54+
'account_sid' => env('TWILIO_ACCOUNT_SID'), //optional
5455
'from' => env('TWILIO_FROM'), // optional
5556
],
5657
...

src/TwilioConfig.php

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,34 @@ public function __construct(array $config)
1919
$this->config = $config;
2020
}
2121

22-
/**
23-
* Get the account sid.
24-
*
25-
* @return string
26-
*/
27-
public function getAccountSid()
22+
/**
23+
* Get the username.
24+
*
25+
* @return string
26+
*/
27+
public function getUsername()
2828
{
29-
return $this->config['account_sid'];
29+
return $this->config['username'];
30+
}
31+
32+
/**
33+
* Get the password.
34+
*
35+
* @return string
36+
*/
37+
public function getPassword()
38+
{
39+
return $this->config['password'];
3040
}
3141

3242
/**
33-
* Get the auth token.
43+
* Get the account sid.
3444
*
3545
* @return string
3646
*/
37-
public function getAuthToken()
47+
public function getAccountSid()
3848
{
39-
return $this->config['auth_token'];
49+
return $this->config['account_sid'];
4050
}
4151

4252
/**

src/TwilioProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function boot()
2323

2424
$this->app->bind(TwilioService::class, function () {
2525
$config = $this->app['config']['services.twilio'];
26-
return new TwilioService($config['account_sid'], $config['auth_token']);
26+
return new TwilioService($config['username'], $config['password'], $config['account_sid']);
2727
});
2828
}
2929

0 commit comments

Comments
 (0)