{"id":52,"date":"2025-05-10T15:36:30","date_gmt":"2025-05-10T10:06:30","guid":{"rendered":"http:\/\/localhost\/mira\/?p=8"},"modified":"2025-06-16T18:11:44","modified_gmt":"2025-06-16T12:41:44","slug":"know-how-to-build-a-chatbot-with-laravel","status":"publish","type":"post","link":"https:\/\/devtechnosys.ae\/blog\/know-how-to-build-a-chatbot-with-laravel\/","title":{"rendered":"How to Build a Chatbot with Laravel &#8211; Ultimate Guide"},"content":{"rendered":"<p>Chatbots have been a revolutionary addition to online businesses. They are becoming very popular and growing rapidly with many companies having their own bots. There are two types of bots, and the first type is the virtual assistant while the second one is the messaging apps.<\/p><div id=\"ez-toc-container\" class=\"ez-toc-v2_0_81 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #000000;color:#000000\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #000000;color:#000000\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/devtechnosys.ae\/blog\/know-how-to-build-a-chatbot-with-laravel\/#How_to_Build_a_Chatbot_with_Laravel\" >How to Build a Chatbot with Laravel?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/devtechnosys.ae\/blog\/know-how-to-build-a-chatbot-with-laravel\/#Token_Access\" >Token Access<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/devtechnosys.ae\/blog\/know-how-to-build-a-chatbot-with-laravel\/#Backend_System\" >Backend System<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/devtechnosys.ae\/blog\/know-how-to-build-a-chatbot-with-laravel\/#Steps_to_Build_Chatbot_in_Laravel\" >Steps to Build Chatbot in Laravel<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/devtechnosys.ae\/blog\/know-how-to-build-a-chatbot-with-laravel\/#First_Step\" >First Step<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/devtechnosys.ae\/blog\/know-how-to-build-a-chatbot-with-laravel\/#In_the_first_step_we_will_install_the_Laravel_58_using_the_command_provided_below_There_are_multiple_Laravel_versions_in_chatbot_like_Laravel_5_Laravel_6_laravel_7_and_Laravel_8_applications\" >In the first step, we will install the Laravel 5.8 using the command provided below. There are multiple Laravel versions in chatbot like Laravel 5, Laravel 6, laravel 7, and Laravel 8 applications.\u00a0\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/devtechnosys.ae\/blog\/know-how-to-build-a-chatbot-with-laravel\/#Second_Step\" >Second Step<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/devtechnosys.ae\/blog\/know-how-to-build-a-chatbot-with-laravel\/#Fourth_Step\" >Fourth Step<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/devtechnosys.ae\/blog\/know-how-to-build-a-chatbot-with-laravel\/#Creating_routes_is_the_next_step_in_enabling_Chatbot_in_Laravel_This_is_done_by_creating_a_route_for_Botman_request_This_is_done_in_the_Bot_PHP_file\" >Creating routes is the next step in enabling Chatbot in Laravel. This is done by creating a route for Botman request. This is done in the Bot PHP file.\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/devtechnosys.ae\/blog\/know-how-to-build-a-chatbot-with-laravel\/#Fifth_Step\" >Fifth Step<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/devtechnosys.ae\/blog\/know-how-to-build-a-chatbot-with-laravel\/#Finalization\" >Finalization<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/devtechnosys.ae\/blog\/know-how-to-build-a-chatbot-with-laravel\/#Read_the_Blog-_Which_is_the_Best_PHP_Web_Development_Framework\" >Read the Blog- Which is the Best PHP Web Development Framework?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/devtechnosys.ae\/blog\/know-how-to-build-a-chatbot-with-laravel\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n<p>In the case of virtual assistants who are powered by machine learning, they can easily keep the information and then learn the patterns of the user.<\/p>\n<p>In the case of messaging apps, they are only capable of having interaction with the users by simply following pre-defined and programmed rules.<\/p>\n<p><strong>Here, we provide a comprehensive and detailed guide to build a chatbot with Laravel as Laravel development has picked up the pace in developing chatbots.<\/strong><\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_Build_a_Chatbot_with_Laravel\"><\/span>How to Build a Chatbot with Laravel?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In order to create a bot like a telegram bot, you can register the bot by calling it a @BotChild account.<\/p>\n<p>Now you need to click on the \/new bot command in order to create a new bot. For instance, you can create \u201cXchange Details Bot\u201d with the username \u201cXchangeDetailsBot\u201d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1010 size-full\" src=\"https:\/\/devtechnosys.ae\/blog\/wp-content\/uploads\/2016\/06\/create-a-bot-1.png\" alt=\"create-a-bot\" width=\"928\" height=\"399\" srcset=\"https:\/\/devtechnosys.ae\/blog\/wp-content\/uploads\/2016\/06\/create-a-bot-1.png 928w, https:\/\/devtechnosys.ae\/blog\/wp-content\/uploads\/2016\/06\/create-a-bot-1-300x129.png 300w, https:\/\/devtechnosys.ae\/blog\/wp-content\/uploads\/2016\/06\/create-a-bot-1-768x330.png 768w\" sizes=\"auto, (max-width: 928px) 100vw, 928px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Token_Access\"><\/span><strong>Token Access<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>After you have created the bot successfully, you need to get token access. Now, save the token into a secret place<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Backend_System\"><\/span><strong>Backend System<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>When it comes to building a backend system, you chose a Laravel framework. Then you need an extra package to easily create the bot. So, you can choose BotMan. It is essentially a framework agnostic PHP library that is designed to easily simplify the task of developing different innovative bots for different messaging platforms. It also has multiple support like messenger, telegram, slack, hipchat, nexmo, wechat as well as Microsoft bot framework. The BotMan comes with its own boilerplate project in the Laravel. The first thing to commit is to create a project by running the command.<\/p>\n<p>In order to make sure that botman is run, first, check the bot with a command.<\/p>\n<p>Now type test and then you will view a response named hello! From the bot.<\/p>\n<p>Now, you have built the bot successfully. The bot logic for the particular botman tinker can easily be found in the file named routes\/botman.php. In order to make the bot even more useful, you need to find a few public APIs. There are different websites that have a wide range of public APIs which you can use. If you feel any difficulty doing that then you can <strong><a href=\"https:\/\/devtechnosys.ae\/dedicated-developers\">hire dedicated developers<\/a><\/strong>, who have rich and proven experience in development.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1008 size-full\" src=\"https:\/\/devtechnosys.ae\/blog\/wp-content\/uploads\/2016\/06\/backend-system.png\" alt=\"backend-system\" width=\"1536\" height=\"800\" srcset=\"https:\/\/devtechnosys.ae\/blog\/wp-content\/uploads\/2016\/06\/backend-system.png 1536w, https:\/\/devtechnosys.ae\/blog\/wp-content\/uploads\/2016\/06\/backend-system-300x156.png 300w, https:\/\/devtechnosys.ae\/blog\/wp-content\/uploads\/2016\/06\/backend-system-768x400.png 768w, https:\/\/devtechnosys.ae\/blog\/wp-content\/uploads\/2016\/06\/backend-system-1024x533.png 1024w\" sizes=\"auto, (max-width: 1536px) 100vw, 1536px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Steps_to_Build_Chatbot_in_Laravel\"><\/span><b>Steps to Build Chatbot in Laravel<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h4><span class=\"ez-toc-section\" id=\"First_Step\"><\/span><span style=\"font-weight: 400;\"><strong>First Step<\/strong><\/span><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<h4><span class=\"ez-toc-section\" id=\"In_the_first_step_we_will_install_the_Laravel_58_using_the_command_provided_below_There_are_multiple_Laravel_versions_in_chatbot_like_Laravel_5_Laravel_6_laravel_7_and_Laravel_8_applications\"><\/span><span style=\"font-weight: 400;\">In the first step, we will install the Laravel 5.8 using the command provided below. There are multiple Laravel versions in chatbot like Laravel 5, Laravel 6, laravel 7, and Laravel 8 applications.\u00a0\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">composer create-project &#8211;prefer-dist laravel\/laravel blog<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><span class=\"ez-toc-section\" id=\"Second_Step\"><\/span><strong>Second Step<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p><span style=\"font-weight: 400;\"> Next, we should install the Botman and Botman Drive. Both have to be installed via running a command. Below are the commands which are required to install botman composer package and also install botman web driver.\u00a0\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><b>Install Botman<\/b><\/p>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">composer require botman\/botman<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><b>Install Botman Drive<\/b><\/p>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">composer require botman\/driver-web<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\"><strong>Third Step\u00a0<\/strong><\/span><\/p>\n<p><span style=\"font-weight: 400;\"> Creating Configuration File, Although these files are not necessary. But creating a configuration file for both driver and cache can eliminate any situation of bugs. So below are the config files for Botman and Botman drive.\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><b>config\/botman\/config.php<\/b><\/p>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>&lt;?php<\/b><\/p>\n<p><b>\u00a0return [<\/b><\/p>\n<p><b>\u00a0<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0&#8216;conversation_cache_time&#8217; =&gt; 40,<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0&#8216;user_cache_time&#8217; =&gt; 30,<\/b><\/p>\n<p><b>];<\/b><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><b>config\/botman\/web.php<\/b><\/p>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>&lt;?php<\/b><\/p>\n<p><b>\u00a0return [<\/b><\/p>\n<p><b>\u00a0<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0&#8216;matchingData&#8217; =&gt; [<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#8216;driver&#8217; =&gt; &#8216;web&#8217;,<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0],<\/b><\/p>\n<p><b>];<\/b><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><span class=\"ez-toc-section\" id=\"Fourth_Step\"><\/span><span style=\"font-weight: 400;\"><strong>Fourth Step<\/strong><\/span><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<h4><span class=\"ez-toc-section\" id=\"Creating_routes_is_the_next_step_in_enabling_Chatbot_in_Laravel_This_is_done_by_creating_a_route_for_Botman_request_This_is_done_in_the_Bot_PHP_file\"><\/span><span style=\"font-weight: 400;\">Creating routes is the next step in enabling Chatbot in Laravel. This is done by creating a route for Botman request. This is done in the Bot PHP file.\u00a0<\/span><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>&nbsp;<\/p>\n<p><b>routes\/web.php<\/b><\/p>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">Route::<\/span><b>get<\/b><span style=\"font-weight: 400;\">(&#8216;\/&#8217;, <\/span><b>function<\/b><span style=\"font-weight: 400;\"> () {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0<\/span><b>return<\/b><span style=\"font-weight: 400;\"> view(&#8216;welcome&#8217;);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">});<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Route::match([&#8216;get&#8217;, &#8216;post&#8217;], &#8216;\/botman&#8217;, &#8216;BotManController@handle&#8217;);<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4><span class=\"ez-toc-section\" id=\"Fifth_Step\"><\/span><strong>Fifth Step<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Next step is to create the Bot Controller. This will enlist the replies, questions or suggestions the bot will use while communicating with anyone.\u00a0<\/span><\/p>\n<p><b>app\/Http\/Controllers\/BotManController.php<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>&lt;?php<\/b><\/p>\n<p><b>\u00a0namespace App\\Http\\Controllers;<\/b><\/p>\n<p><b>\u00a0use BotMan\\BotMan\\BotMan;<\/b><\/p>\n<p><b>use Illuminate\\Http\\Request;<\/b><\/p>\n<p><b>use BotMan\\BotMan\\Messages\\Incoming\\Answer;<\/b><\/p>\n<p><b>\u00a0class BotManController extends Controller<\/b><\/p>\n<p><b>{<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\/**<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0* Place your BotMan logic here.<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0*\/<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0public function handle()<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0{<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$botman = app(&#8216;botman&#8217;);<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$botman-&gt;hears(&#8216;{message}&#8217;, function($botman, $message) {<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if ($message == &#8216;hi&#8217;) {<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$this-&gt;askName($botman);<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}else{<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$botman-&gt;reply(&#8220;write &#8216;hi&#8217; for testing&#8230;&#8221;);<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0});<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$botman-&gt;listen();<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0}<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0\/**<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0* Place your BotMan logic here.<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0*\/<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0public function askName($botman)<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0{<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$botman-&gt;ask(&#8216;Hello! What is your Name?&#8217;, function(Answer $answer) {<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$name = $answer-&gt;getText();<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$this-&gt;say(&#8216;Nice to meet you &#8216;.$name);<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0});<\/b><\/p>\n<p><b>\u00a0\u00a0\u00a0}<\/b><\/p>\n<p><b>}<\/b><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><strong>Sixth Step<\/strong><\/p>\n<p><span style=\"font-weight: 400;\"> We now just have to update the Botfile and Bot codes on the welcome balde file.It is added in the welcome.blade.php file.<\/span><\/p>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">&lt;!doctype html&gt;<\/span><\/p>\n<p><b>&lt;html&gt;<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0<\/span><b>&lt;head&gt;<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><b>&lt;meta<\/b> <b>charset<\/b><span style=\"font-weight: 400;\">=&#8221;utf-8&#8243;<\/span><b>&gt;<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><b>&lt;meta<\/b> <b>name<\/b><span style=\"font-weight: 400;\">=&#8221;viewport&#8221; <\/span><b>content<\/b><span style=\"font-weight: 400;\">=&#8221;width=device-width, initial-scale=1&#8243;<\/span><b>&gt;<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><b>&lt;title&gt;<\/b><span style=\"font-weight: 400;\">How to install Botman Chatbot in Laravel 5? &#8211; devtechnosys.ae<\/span><b>&lt;\/title&gt;<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><b>&lt;link<\/b> <b>href<\/b><span style=\"font-weight: 400;\">=&#8221;https:\/\/fonts.googleapis.com\/css?family=Nunito:200,600&#8243; <\/span><b>rel<\/b><span style=\"font-weight: 400;\">=&#8221;stylesheet&#8221;<\/span><b>&gt;<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><b>&lt;style&gt;<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0html, body {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0background-color: #fff;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0color: #636b6f;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0font-family: &#8216;Nunito&#8217;, sans-serif;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0font-weight: 200;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0height: 100vh;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0margin: 0;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><b>&lt;\/style&gt;<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0<\/span><b>&lt;\/head&gt;<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0<\/span><b>&lt;body&gt;<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0<\/span><b>&lt;\/body&gt;<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0<\/span><b>&lt;link<\/b> <b>rel<\/b><span style=\"font-weight: 400;\">=&#8221;stylesheet&#8221; <\/span><b>type<\/b><span style=\"font-weight: 400;\">=&#8221;text\/css&#8221; <\/span><b>href<\/b><span style=\"font-weight: 400;\">=&#8221;https:\/\/cdn.jsdelivr.net\/npm\/botman-web-widget@0\/build\/assets\/css\/chat.min.css&#8221;<\/span><b>&gt;<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0<\/span><b>&lt;script&gt;<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0 \u00a0 <\/span><b>var<\/b><span style=\"font-weight: 400;\"> botmanWidget = {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 aboutText: &#8216;ssdsd&#8217;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 \u00a0 introMessage: &#8220;\u270b Hi! I&#8217;m form Devtechnosys.ae&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0 \u00a0 };<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0<\/span><b>&lt;\/script&gt;<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0<\/span><b>&lt;script<\/b> <b>src<\/b><span style=\"font-weight: 400;\">=&#8217;https:\/\/cdn.jsdelivr.net\/npm\/botman-web-widget@0\/build\/js\/widget.js&#8217;<\/span><b>&gt;&lt;\/script&gt;<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0<\/span><\/p>\n<p><b>&lt;\/html&gt;<\/b><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">And now we are good to go with a chatbot in our Laravel.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Finalization\"><\/span><strong>Finalization<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Now, setup the file named .env and add the telegram token which you have already created. Open the file named BotManController.php, and in order to create a particularly new pattern, add hears method and then add the pattern you wish, and to make the response of your own pattern, add reply method.<\/p>\n<p>Whenever you type hello to the bot, you will receive the response mentioned in the reply method. If you type any other word, then you won\u2019t view anything.<\/p>\n<p>BotMan essentially comes with its own fallback method, which is called in case any of the \u201chears\u201d patterns don\u2019t match. You will certainly find these particular features quite useful to add to your user guide on how to actually use the bot.<\/p>\n<blockquote>\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Read_the_Blog-_Which_is_the_Best_PHP_Web_Development_Framework\"><\/span>Read the Blog- <a href=\"https:\/\/devtechnosys.com\/which-is-the-best-php-web-development-framework\" target=\"_blank\" rel=\"noopener\"><strong>Which is the Best PHP Web Development Framework?<\/strong><\/a><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<\/blockquote>\n<p>In order to make the bot, even more, feel and act like a human, you can make it the words sending \u201ctyping\u2026\u201d indicators by simply add types method before the given reply method.<\/p>\n<p>Sometimes you may require to capture any parameter from the input for the users, then in botman, you can easily define the command parameter too.<\/p>\n<p>In order to enable your bot with multiple features, you can add more APIs. In order to get data from the APO, you can handle the API with the Guzzle library which already exists in the Laravel project. Now you need to create a new method right within the BotManControllerphp named getDetails() with the parameter that users provide.<\/p>\n<p>Call get Details method before the reply method. Once you have successfully done this, you need to run the development server. After this install ngrok in order to make your own server Now run the ngrok server on the given port 8000 which is the default development port of Laravel.<\/p>\n<p>After the ngrok run, now connect the bot with the telegram hook. You need to make sure that you particularly choose the ngrok https since telegram bot only runs in the https.<\/p>\n<p>Now the hook is successfully set up. Now type \u201cGive me {Currency } details\u201d.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span><strong>Conclusion<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>With the advent of the latest technologies in order to enable the users to easily communicate with businesses, Chatbots have certainly made things quite easier. You can easily do laravel app development in order to develop a chatbot using Laravel in case you require a robust chatbot.<\/p>\n<p>With this article, we have explained how you can develop such a bot with Laravel. <strong><a href=\"https:\/\/devtechnosys.com\/hire-laravel-developers.php\" target=\"_blank\" rel=\"noopener\">Hire Laravel developers<\/a><\/strong> who have complete knowledge of developing a chatbot with Laravel if your business requires a chatbot for its different purposes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Chatbots have been a revolutionary addition to online businesses. They are becoming very popular and growing rapidly with many companies having their own bots. There are two types of bots, and the first type is the virtual assistant while the second one is the messaging apps. In the case of virtual assistants who are powered by machine learning, they can&#8230;<\/p>\n","protected":false},"author":1,"featured_media":1006,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[31],"tags":[136,36,34,35],"class_list":["post-52","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php-development","tag-chatbot-development","tag-laravel-development","tag-php-development","tag-web-development"],"acf":[],"_links":{"self":[{"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/posts\/52","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/comments?post=52"}],"version-history":[{"count":11,"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/posts\/52\/revisions"}],"predecessor-version":[{"id":13538,"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/posts\/52\/revisions\/13538"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/media\/1006"}],"wp:attachment":[{"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/media?parent=52"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/categories?post=52"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devtechnosys.ae\/blog\/wp-json\/wp\/v2\/tags?post=52"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}