File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed
Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change 1919 "botman/botman" : " ~2.0"
2020 },
2121 "require-dev" : {
22+ "botman/studio-addons" : " ~1.0" ,
23+ "illuminate/contracts" : " ~5.5.0" ,
2224 "phpunit/phpunit" : " ~5.0" ,
2325 "mockery/mockery" : " dev-master" ,
2426 "ext-curl" : " *"
3638 "scripts" : {
3739 "test" : " vendor/bin/phpunit" ,
3840 "cs" : " php-cs-fixer fix"
41+ },
42+ "extra" : {
43+ "laravel" : {
44+ "providers" : [
45+ " BotMan\\ Drivers\\ Nexmo\\ Providers\\ NexmoServiceProvider"
46+ ]
47+ }
3948 }
4049}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace BotMan \Drivers \Nexmo \Providers ;
4+
5+ use BotMan \Drivers \Nexmo \NexmoDriver ;
6+ use Illuminate \Support \ServiceProvider ;
7+ use BotMan \BotMan \Drivers \DriverManager ;
8+ use BotMan \Studio \Providers \StudioServiceProvider ;
9+
10+ class NexmoServiceProvider extends ServiceProvider
11+ {
12+ /**
13+ * Perform post-registration booting of services.
14+ *
15+ * @return void
16+ */
17+ public function boot ()
18+ {
19+ if (! $ this ->isRunningInBotManStudio ()) {
20+ $ this ->loadDrivers ();
21+
22+ $ this ->publishes ([
23+ __DIR__ .'/../../stubs/nexmo.php ' => config_path ('botman/nexmo.php ' ),
24+ ]);
25+
26+ $ this ->mergeConfigFrom (__DIR__ .'/../../stubs/nexmo.php ' , 'botman.nexmo ' );
27+ }
28+ }
29+
30+ /**
31+ * Load BotMan drivers.
32+ */
33+ protected function loadDrivers ()
34+ {
35+ DriverManager::loadDriver (NexmoDriver::class);
36+ }
37+
38+ /**
39+ * @return bool
40+ */
41+ protected function isRunningInBotManStudio ()
42+ {
43+ return class_exists (StudioServiceProvider::class);
44+ }
45+ }
You can’t perform that action at this time.
0 commit comments