squareetlabs /
LaravelSmsUp
| 1 | <?php |
||
| 2 | |||
| 3 | namespace SquareetLabs\LaravelSmsUp; |
||
| 4 | |||
| 5 | use Illuminate\Notifications\ChannelManager; |
||
| 6 | use Illuminate\Support\Facades\Notification; |
||
| 7 | use Illuminate\Support\Facades\Route; |
||
| 8 | use Illuminate\Support\ServiceProvider; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * Class SmsUpServiceProvider |
||
| 12 | * @package SquareetLabs\LaravelSmsUp |
||
| 13 | */ |
||
| 14 | class SmsUpServiceProvider extends ServiceProvider |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * Register. |
||
| 18 | */ |
||
| 19 | public function register() |
||
| 20 | { |
||
| 21 | Notification::resolved(function (ChannelManager $service) { |
||
| 22 | $service->extend('smsUp', function () { |
||
| 23 | return new SmsUpChannel(); |
||
| 24 | }); |
||
| 25 | }); |
||
| 26 | $this->app->bind('smsUp', function() { |
||
| 27 | return new SmsUpManager(config('services.smsUp')); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 28 | }); |
||
| 29 | |||
| 30 | $this->registerRoutes(); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Register the package routes. |
||
| 35 | * |
||
| 36 | * @return void |
||
| 37 | */ |
||
| 38 | private function registerRoutes() |
||
| 39 | { |
||
| 40 | Route::group($this->routeConfiguration(), function () { |
||
| 41 | $this->loadRoutesFrom(__DIR__.'/Http/routes.php'); |
||
| 42 | }); |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Get the SmsUp route group configuration array. |
||
| 47 | * |
||
| 48 | * @return array |
||
| 49 | */ |
||
| 50 | private function routeConfiguration() |
||
| 51 | { |
||
| 52 | return [ |
||
| 53 | 'domain' => null, |
||
| 54 | 'namespace' => 'SquareetLabs\LaravelSmsUp\Http\Controllers', |
||
| 55 | 'prefix' => 'smsup' |
||
| 56 | ]; |
||
| 57 | } |
||
| 58 | } |