diff --git a/composer.json b/composer.json index b82feef..373719b 100644 --- a/composer.json +++ b/composer.json @@ -20,6 +20,8 @@ "botman/botman": "~2.0" }, "require-dev": { + "botman/studio-addons": "~1.0", + "illuminate/contracts": "~5.5.0", "phpunit/phpunit": "~5.0", "mockery/mockery": "dev-master", "ext-curl": "*" @@ -37,5 +39,12 @@ "scripts": { "test": "vendor/bin/phpunit", "cs": "php-cs-fixer fix" + }, + "extra": { + "laravel": { + "providers": [ + "BotMan\\Drivers\\CiscoSpark\\Providers\\CiscoSparkServiceProvider" + ] + } } } diff --git a/src/Providers/CiscoSparkServiceProvider.php b/src/Providers/CiscoSparkServiceProvider.php new file mode 100644 index 0000000..c0dce11 --- /dev/null +++ b/src/Providers/CiscoSparkServiceProvider.php @@ -0,0 +1,45 @@ +isRunningInBotManStudio()) { + $this->loadDrivers(); + + $this->publishes([ + __DIR__.'/../../stubs/cisco-spark.php' => config_path('botman/cisco-spark.php'), + ]); + + $this->mergeConfigFrom(__DIR__.'/../../stubs/cisco-spark.php', 'botman.cisco-spark'); + } + } + + /** + * Load BotMan drivers. + */ + protected function loadDrivers() + { + DriverManager::loadDriver(CiscoSparkDriver::class); + } + + /** + * @return bool + */ + protected function isRunningInBotManStudio() + { + return class_exists(StudioServiceProvider::class); + } +}