Save botman chat to Mysql

  botman, laravel, mysql

i’m working on an online helpdesk system with botman, can anyone please help me with how to save the chat to database
this is what i have so far

public function askName()
{
    $this->ask('May i know your name before we start?', function(Answer $answer) {
        $this->bot->userStorage()->save([
            'name'=> $answer->getText(),
        ]);

        $this->say('Welcome '. $answer->getText());
        $this->askReg();
    });
}

public function askReg()
{
    $this->ask('what is your registration number?', function(Answer $answer) {
       $this->bot->userStorage()->save([
            'regno'=> $answer->getText(),
        ]);
       $this->say('Great!');

       $this->bot->startConversation(new SelectServiceConversation());
    });
}

public function run()
{
    $this->askName();
}

Source: Laravel

Leave a Reply