Botman in Laravel
Posted By : Piyush Mishra | 30-Jun-2022
What is Chatbot??
At the basic level, a chatbot is a computer program that simulates and processes human conversation allowing humans to interact with the digital services as if they were communicating with a real person. Chatbots can be simple as rudimentary programs that answer a simple query with single-liner commands or as sophisticated as digital assistants that learn and evolve to deliver increasing levels of the scenario the basic personalization we can do on it, they gather and process information.
You probably interacted with a chatbot whether you know it or not. For example, a window pops up on your screen asking if you will check-in and perhaps it commands on your way to a concert and you use your smartphone to request a ride via chat or you might have used voice commands to order a coffee and receive a response telling when your order will be ready and what it will cost. These are examples of scenarios in which you could understand the chatbot functionalities.
Now are the Steps to install Botman
To get the function of the chatbot
next, we need to install botman into the laravel setup
Open the terminal of the project and run these commands
COMMAND 1:- composer require botman/botman
COMMAND 2 :- composer require botman/driver-web
Create config file
This config file is for driver and cache.
let's create a folder with the name botman inside /config directory
Create two files inside/ config/botman
open project into the terminal and run this artisan command
$ php artisan make:controller BotmanController
It will create the BotManContoller.php file in /app/Http/Controllers folder.
Add Route Now
Open web.php from /routes folder and add this route
Create Blade File
open any of the view files from your application I am opening the default view file welcome.blade.php
add this simple code to it...
Open the project to the terminal and type the commands to start the development server
$ PHP artisan serve