Skip to content

Commit

Permalink
Add botman routes file
Browse files Browse the repository at this point in the history
  • Loading branch information
mpociot committed Dec 15, 2016
1 parent d2ad5b1 commit ba99f0f
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 125 deletions.
15 changes: 10 additions & 5 deletions app/Http/Controllers/BotManController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Controllers;

use App\Conversations\ExampleConversation;
use Illuminate\Http\Request;
use Mpociot\BotMan\BotMan;

Expand All @@ -20,11 +21,15 @@ public function handle()
$bot->reply('Hi there :)');
});

// Start a conversation
$botman->hears('Start conversation', function (BotMan $bot) {
$bot->startConversation(new ExampleConversation());
});

$botman->listen();
}

/**
* Loaded through routes/botman.php
* @param BotMan $bot
*/
public function startConversation(BotMan $bot)
{
$bot->startConversation(new ExampleConversation());
}
}
1 change: 1 addition & 0 deletions app/Http/Middleware/VerifyCsrfToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class VerifyCsrfToken extends BaseVerifier
* @var array
*/
protected $except = [
'botman',
'botman/*'
];
}
2 changes: 1 addition & 1 deletion app/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function map()

$this->mapWebRoutes();

//
require base_path('routes/botman.php');
}

/**
Expand Down
Loading

0 comments on commit ba99f0f

Please sign in to comment.