| 1 | <?php |
||
| 8 | class TwilioProvider extends ServiceProvider |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Bootstrap the application services. |
||
| 12 | */ |
||
| 13 | 1 | public function boot() |
|
| 14 | { |
||
| 15 | 1 | $this->app->when(TwilioChannel::class) |
|
| 16 | 1 | ->needs(Twilio::class) |
|
| 17 | ->give(function () { |
||
| 18 | |||
| 19 | 1 | $config = $this->app['config']['services.twilio']; |
|
| 20 | |||
| 21 | 1 | return new Twilio( |
|
| 22 | 1 | $this->app->make(TwilioService::class), |
|
| 23 | 1 | $config['from'] |
|
| 24 | ); |
||
| 25 | 1 | }); |
|
| 26 | |||
| 27 | 1 | $this->app->bind(TwilioService::class, function () { |
|
| 28 | 1 | $config = $this->app['config']['services.twilio']; |
|
| 29 | |||
| 30 | 1 | return new TwilioService($config['account_sid'], $config['auth_token']); |
|
| 31 | 1 | }); |
|
| 32 | 1 | } |
|
| 33 | |||
| 34 | /** |
||
| 35 | * Register the application services. |
||
| 36 | */ |
||
| 37 | public function register() |
||
| 40 | } |
||
| 41 |