Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
50.00% |
1 / 2 |
CRAP | |
47.37% |
9 / 19 |
| LaravelTelnyxServiceProvider | |
0.00% |
0 / 1 |
|
50.00% |
1 / 2 |
4.31 | |
47.37% |
9 / 19 |
| boot | |
100.00% |
1 / 1 |
2 | |
100.00% |
5 / 5 |
|||
| register | |
0.00% |
0 / 1 |
1.36 | |
28.57% |
4 / 14 |
|||
| 1 | <?php |
| 2 | |
| 3 | namespace AGILEDROP\LaravelTelnyx; |
| 4 | |
| 5 | use Illuminate\Notifications\ChannelManager; |
| 6 | use Illuminate\Support\Facades\Notification; |
| 7 | use Illuminate\Support\ServiceProvider; |
| 8 | |
| 9 | class LaravelTelnyxServiceProvider extends ServiceProvider |
| 10 | { |
| 11 | public function boot() |
| 12 | { |
| 13 | if ($this->app->runningInConsole()) { |
| 14 | $this->publishes([ |
| 15 | __DIR__ . '/../config/laravel-telnyx.php' => config_path('laravel-telnyx.php'), |
| 16 | ], 'config'); |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Register the service provider. |
| 22 | * |
| 23 | * @return void |
| 24 | */ |
| 25 | public function register() |
| 26 | { |
| 27 | $this->mergeConfigFrom(__DIR__ . '/../config/laravel-telnyx.php', 'laravel-telnyx'); |
| 28 | |
| 29 | Notification::resolved(function (ChannelManager $service) { |
| 30 | $service->extend('telnyx-sms', function ($app) { |
| 31 | return new Channels\SmsChannel( |
| 32 | config('laravel-telnyx.messaging_profile_id'), |
| 33 | config('laravel-telnyx.from') |
| 34 | ); |
| 35 | }); |
| 36 | $service->extend('telnyx-mms', function ($app) { |
| 37 | return new Channels\MmsChannel( |
| 38 | config('laravel-telnyx.messaging_profile_id'), |
| 39 | config('laravel-telnyx.from') |
| 40 | ); |
| 41 | }); |
| 42 | }); |
| 43 | } |
| 44 | } |