crafted-systems /
laravel-sms
| 1 | <?php |
||
| 2 | |||
| 3 | namespace CraftedSystems\LaravelSMS; |
||
| 4 | |||
| 5 | use CraftedSystems\LaravelSMS\Console\MakeGatewayCommand; |
||
| 6 | use Illuminate\Support\ServiceProvider; |
||
| 7 | |||
| 8 | class SMSServiceProvider extends ServiceProvider |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Bootstrap the application services. |
||
| 12 | * |
||
| 13 | * @return void |
||
| 14 | */ |
||
| 15 | public function boot() |
||
| 16 | { |
||
| 17 | $this->publishes([ |
||
| 18 | __DIR__.'/Config/sms.php' => config_path('sms.php'), |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 19 | ], 'laravel_sms_config'); |
||
| 20 | |||
| 21 | $this->app->singleton(SMS::class, function () { |
||
| 22 | return new SMS(); |
||
| 23 | }); |
||
| 24 | |||
| 25 | $this->app->alias(SMS::class, 'sms'); |
||
| 26 | |||
| 27 | if ($this->app->runningInConsole()) { |
||
| 28 | $this->commands([ |
||
| 29 | MakeGatewayCommand::class, |
||
| 30 | ]); |
||
| 31 | } |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Register the application services. |
||
| 36 | * |
||
| 37 | * @return void |
||
| 38 | */ |
||
| 39 | public function register() |
||
| 40 | { |
||
| 41 | $this->mergeConfigFrom( |
||
| 42 | __DIR__.'/Config/sms.php', |
||
| 43 | 'laravel-sms' |
||
| 44 | ); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |