Skip to content

Instantly share code, notes, and snippets.

@emtudo
Created October 14, 2017 20:42
Show Gist options
  • Save emtudo/f7e9292a18774ddd217bb915fcc54f7e to your computer and use it in GitHub Desktop.
Save emtudo/f7e9292a18774ddd217bb915fcc54f7e to your computer and use it in GitHub Desktop.
<?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