Created
October 14, 2017 20:42
-
-
Save emtudo/f7e9292a18774ddd217bb915fcc54f7e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
use BotMan\BotMan\Cache\LaravelCache; | |
use BotMan\BotMan\Storages\Drivers\FileStorage; | |
use BotMan\BotMan\BotManFactory; | |
use BotMan\Drivers\Facebook\FacebookDriver; | |
use BotMan\BotMan\Drivers\DriverManager; | |
class BotManServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Bootstrap any application services. | |
* | |
* @return void | |
*/ | |
public function boot() | |
{ | |
} | |
/** | |
* Register any application services. | |
* | |
* @return void | |
*/ | |
public function register() | |
{ | |
DriverManager::loadDriver(FacebookDriver::class); | |
$this->app->singleton('botman', function($app) { | |
$storage = new FileStorage(storage_path('botman')); | |
return BotManFactory::create( | |
config('botman', []), | |
new LaravelCache(), | |
$app->make('request'), $storage | |
); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment