Open TeamTracer opened 6 years ago
@christophrumpel, I tried to replicate botman studio, everything is working except the botman.php route. Codes written there doesn't seem to work. I also edited the app/providers/routeserviceprovider.php but it still doesn't work.
Follow these steps:
composer require botman/botman
composer require botman/driver-facebook
or driver you needYourController
with two methods.
use following code:
<?php
namespace App\Http\Controllers;
//load BotMan use BotMan\BotMan\BotMan; use BotMan\BotMan\BotManFactory; use BotMan\BotMan\Drivers\DriverManager; class MessengerController extends Controller { //load facebook messenger driver, or driver you need DriverManager::loadDriver(\BotMan\Drivers\Facebook\FacebookDriver::class); $cacheDriver = new \Doctrine\Common\Cache\PhpFileCache('cache'); $botman = BotManFactory::create(config('botman', new DoctrineCache($cacheDriver))); $botman->hears('hi', function (BotMan $bot) { $bot->reply('Hello Yourself'); }); } ?>
5. In your routes/web.php file use:
`Route::match(['get', 'post'],'/webhook', 'MessengerController@webhook');`
@TeamTracer any updates here?
@christophrumpel, I haven't found any solutions. Instead I installed laravel 5.6, added botman and then replicated the remaining files of a fresh copy of botman studio. I wrote all the codes in the controller not in botman.php route.
show your code in controller
Is there no way to add conversations while using botman in an existing laravel project?
You can create folder named conversations in app directory and use them like in botman studio.
it isn't working that way. already tried!
I am also somewhat frustrated in my attempt to add this to a Laravel 5.7 project. Would be great to see an official guide added to the docs.
You’ve got to add the botman.php route in RouteServiceProvider.php
Any update on that? Official instructions would be great!
I subscribed to the $25.00 pack and saw the videos. They had all the information for adding botman to existing project and even for starting-from-scratch project. I honestly forgot how I did it, but the I do remember that the video has the required information.
I know, the topic is now 3 years old. But there seems to be a solution with this video from the creators of "Botman".
https://beyondco.de/course/build-a-chatbot/getting-started/add-botman-to-your-laravel-app
I found the most straightforward way was to copy the botman-related files from the BotMan Studio Laravel project.
Hey @TeamTracer ,
there is no official guide to do so. I would ask in the BotMan Slack channel, I am sure there are some people who already did that. If you need help you should also provide exact problems and errors, please!
Generally speaking, you need to:
listen
method. (The botman.php route file from BotMan Studio is only in the Studio version loaded automatically)But I haven't done it myself yet.