SlideShare a Scribd company logo
Laravel UA Chatbot
How was that..
Agenda
➔ Chatbots with Laravel, is there a life?
➔ Botman overview
➔ How the code looks
➔ Development pitfalls
➔ Deployment tricks
➔ Conclusion
➔ Links
Chatbots with Laravel, is there a life?
➔ Chatbot is another interface for your application
➔ There are Bot Frameworks and Bot Platforms..
➔ Most popular among them:
◆ Bot Platforms: Chatfuel, Motion.ai, Botsify, FlowXO, etc.
◆ Bot Frameworks: Microsoft Bot Framework, Wit.ai, Api.ai, Aspect NLU, etc.
◆ And PHP Frameworks: BotMan, Fondbot, etc.
➔ Most popular PHP framework is BotMan
Botman overview
➔ Utilizes Laravel framework
➔ Has drivers for: Facebook Messenger, Slack, Telegram, Skype, Kik, Twilio,
Alexa, Cisco Spark, Hangouts Chat, HipChat, Nexmo, WeChat, Web.
➔ Extensive documentation and video course.
➔ Concepts: deals with messages and attachments, handles visual components,
conversations, embedded events, testing and middleware support, includes
initializing commands, has integrated NLP (Natural Language Processing)
services
How the code looks
Simple Replying
// Process incoming message
$botman->listen();
$botman->hears('foo', function ($bot) {
$bot->reply('Hello World');
});
$botman->hears('foo', 'SomeNamespaceMyBotCommands@handleFoo');
class MyBotCommands {
public function handleFoo($bot) {
$bot->reply('Hello World');
}
}
How the code looks
Sending attachments
// Process incoming message
$botman->listen();
$botman->hears('foo', function ($bot) {
$bot->reply('Hello World');
});
$botman->hears('foo', 'SomeNamespaceMyBotCommands@handleFoo');
class MyBotCommands {
public function handleFoo($bot) {
$attachment = new Image('http://image-url-here.jpg'); // and Video,Audio,File,Location
$message = OutgoingMessage::create('This is my text')->withAttachment($attachment);
$bot->reply($message);
}
}
How the code looks
Conversations
$botman->hears('Hello', function($bot) {
$bot->startConversation(new OnboardingConversation);
});
class OnboardingConversation extends Conversation
{
protected $firstname;
public function run()
{
$this->ask('Hello! What is your firstname?', function(Answer $answer) {
$this->firstname = $answer->getText();
$this->say('Nice to meet you '.$this->firstname);
});
}
}
How the code looks
Listening for attachments
$bot->receivesImages(function($bot, $images) {
foreach ($images as $image) {
$url = $image->getUrl(); // The direct url
$title = $image->getTitle(); // The title, if available
$payload = $image->getPayload(); // The original payload
}
});
$bot->receivesVideos(..
$bot->receivesAudio(..
$bot->receivesFiles(..
$bot->receivesLocation(..
Development pitfalls
➔ Proactive messages:
E.g. Facebook 24+1 policy
➔ Localization:
Check locale with platform API vs Self made localization
➔ Visual components limitations:
Each platform has its own set of components, which often limited in styling
Development pitfalls
➔ Payments (are complicated and not standardized):
Built-in:
◆ Facebook: Stripe, Paypal, Tokenized (US only)
◆ Telegram: Stripe, Paymentwall, Yandex.Money, Payme, Apple and Android Pay
◆ Skype: manual integration of PayPal, Stripe
External:
◆ External links, payment bots, Masterpass, Slack’s Paypal bot, Privat payment bot (VIber and
Telegram)
Deployment tricks
➔ Messengers are different and they require individual approach, RTFM
◆ Facebook:
Prepare Privacy Policy, submit for review with
◆ Telegram and Slack:
Quick and transparent. Botfather (Telegram) and Slack API Center
◆ Viber:
Don’t wait until they apply you, because it may never happen :)
Conclusion
➔ We can use PHP and Laravel nevertheless is not that popular among biggest
frameworks;
➔ Botman is a decent tool for chatbot development and IMHO preferable with
PHP ecosystem;
➔ Look into native API, always!
➔ There are set of nuances specific for each platform, could be solvable or not!
Links
LaravelUA bot at Facebook: https://www.facebook.com/ualaravelgroup/ and in
Messenger: https://www.messenger.com/t/ualaravelgroup
Telegram: @laravelua_bot (https://telegram.me/laravelua_bot)
Oleksandr Tymchenko
Keep coding..
Thank you!

More Related Content

PDF
Lastest Trends in Web Development
ODP
Joomla REST API
PPT
Bri forum advanced web interface customizations
PPT
Advanced Web Interface Customizations - BriForum 2010
PDF
Bot template framework
PPTX
Creating Chatbots with Botman - English
PPTX
Laravel Poznań Meetup #2 - Creating chatbots with BotMan
PDF
The PHP developer stack for building chatbots | Christoph Rumpel | CODEiD
Lastest Trends in Web Development
Joomla REST API
Bri forum advanced web interface customizations
Advanced Web Interface Customizations - BriForum 2010
Bot template framework
Creating Chatbots with Botman - English
Laravel Poznań Meetup #2 - Creating chatbots with BotMan
The PHP developer stack for building chatbots | Christoph Rumpel | CODEiD

Similar to Laravel ua chatbot (20)

PPT
Bridging the Gap - Laracon 2013
PDF
Bot-Tender: A Chat Bot Walks into a Bar (Microsoft Tech Days Sweden 2018)
PDF
Chatbots DDD North2016
PDF
Build your first messenger bot
PPTX
Using Chatbots in Extension Programming
PDF
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
PPTX
Laravel introduction
PPTX
Chatbots
PDF
3 different flavours of building chatbots with Microsoft
PDF
How to build a Chatbot with Google's Dialogflow
PDF
Chatbots 101
PPTX
Build a mobile chatbot with Xamarin
PPTX
Isa632 final-presentation
PPTX
How to Build a Chatbot with Tom Martin, Founder of LawDroid
PDF
[TechWorldSummit Stockholm 2019] Building Bots for Human with Conversational ...
PPTX
Laravel совместимые технологии
PDF
DevOps in PHP environment
PDF
Top 10 Laravel Development Tools in 2024
PDF
What is Laravel and Why Should You Choose it for Your Next Project?
PDF
Lessons learned from building a commercial bot development platform
Bridging the Gap - Laracon 2013
Bot-Tender: A Chat Bot Walks into a Bar (Microsoft Tech Days Sweden 2018)
Chatbots DDD North2016
Build your first messenger bot
Using Chatbots in Extension Programming
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
Laravel introduction
Chatbots
3 different flavours of building chatbots with Microsoft
How to build a Chatbot with Google's Dialogflow
Chatbots 101
Build a mobile chatbot with Xamarin
Isa632 final-presentation
How to Build a Chatbot with Tom Martin, Founder of LawDroid
[TechWorldSummit Stockholm 2019] Building Bots for Human with Conversational ...
Laravel совместимые технологии
DevOps in PHP environment
Top 10 Laravel Development Tools in 2024
What is Laravel and Why Should You Choose it for Your Next Project?
Lessons learned from building a commercial bot development platform
Ad

Recently uploaded (20)

PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
DP Operators-handbook-extract for the Mautical Institute
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
August Patch Tuesday
PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PPTX
Tartificialntelligence_presentation.pptx
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
Mushroom cultivation and it's methods.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Univ-Connecticut-ChatGPT-Presentaion.pdf
SOPHOS-XG Firewall Administrator PPT.pptx
DP Operators-handbook-extract for the Mautical Institute
TLE Review Electricity (Electricity).pptx
Zenith AI: Advanced Artificial Intelligence
Hindi spoken digit analysis for native and non-native speakers
Unlocking AI with Model Context Protocol (MCP)
MIND Revenue Release Quarter 2 2025 Press Release
August Patch Tuesday
Web App vs Mobile App What Should You Build First.pdf
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Encapsulation_ Review paper, used for researhc scholars
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Tartificialntelligence_presentation.pptx
OMC Textile Division Presentation 2021.pptx
WOOl fibre morphology and structure.pdf for textiles
Mushroom cultivation and it's methods.pdf
NewMind AI Weekly Chronicles - August'25-Week II
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Ad

Laravel ua chatbot

  • 2. Agenda ➔ Chatbots with Laravel, is there a life? ➔ Botman overview ➔ How the code looks ➔ Development pitfalls ➔ Deployment tricks ➔ Conclusion ➔ Links
  • 3. Chatbots with Laravel, is there a life? ➔ Chatbot is another interface for your application ➔ There are Bot Frameworks and Bot Platforms.. ➔ Most popular among them: ◆ Bot Platforms: Chatfuel, Motion.ai, Botsify, FlowXO, etc. ◆ Bot Frameworks: Microsoft Bot Framework, Wit.ai, Api.ai, Aspect NLU, etc. ◆ And PHP Frameworks: BotMan, Fondbot, etc. ➔ Most popular PHP framework is BotMan
  • 4. Botman overview ➔ Utilizes Laravel framework ➔ Has drivers for: Facebook Messenger, Slack, Telegram, Skype, Kik, Twilio, Alexa, Cisco Spark, Hangouts Chat, HipChat, Nexmo, WeChat, Web. ➔ Extensive documentation and video course. ➔ Concepts: deals with messages and attachments, handles visual components, conversations, embedded events, testing and middleware support, includes initializing commands, has integrated NLP (Natural Language Processing) services
  • 5. How the code looks Simple Replying // Process incoming message $botman->listen(); $botman->hears('foo', function ($bot) { $bot->reply('Hello World'); }); $botman->hears('foo', 'SomeNamespaceMyBotCommands@handleFoo'); class MyBotCommands { public function handleFoo($bot) { $bot->reply('Hello World'); } }
  • 6. How the code looks Sending attachments // Process incoming message $botman->listen(); $botman->hears('foo', function ($bot) { $bot->reply('Hello World'); }); $botman->hears('foo', 'SomeNamespaceMyBotCommands@handleFoo'); class MyBotCommands { public function handleFoo($bot) { $attachment = new Image('http://image-url-here.jpg'); // and Video,Audio,File,Location $message = OutgoingMessage::create('This is my text')->withAttachment($attachment); $bot->reply($message); } }
  • 7. How the code looks Conversations $botman->hears('Hello', function($bot) { $bot->startConversation(new OnboardingConversation); }); class OnboardingConversation extends Conversation { protected $firstname; public function run() { $this->ask('Hello! What is your firstname?', function(Answer $answer) { $this->firstname = $answer->getText(); $this->say('Nice to meet you '.$this->firstname); }); } }
  • 8. How the code looks Listening for attachments $bot->receivesImages(function($bot, $images) { foreach ($images as $image) { $url = $image->getUrl(); // The direct url $title = $image->getTitle(); // The title, if available $payload = $image->getPayload(); // The original payload } }); $bot->receivesVideos(.. $bot->receivesAudio(.. $bot->receivesFiles(.. $bot->receivesLocation(..
  • 9. Development pitfalls ➔ Proactive messages: E.g. Facebook 24+1 policy ➔ Localization: Check locale with platform API vs Self made localization ➔ Visual components limitations: Each platform has its own set of components, which often limited in styling
  • 10. Development pitfalls ➔ Payments (are complicated and not standardized): Built-in: ◆ Facebook: Stripe, Paypal, Tokenized (US only) ◆ Telegram: Stripe, Paymentwall, Yandex.Money, Payme, Apple and Android Pay ◆ Skype: manual integration of PayPal, Stripe External: ◆ External links, payment bots, Masterpass, Slack’s Paypal bot, Privat payment bot (VIber and Telegram)
  • 11. Deployment tricks ➔ Messengers are different and they require individual approach, RTFM ◆ Facebook: Prepare Privacy Policy, submit for review with ◆ Telegram and Slack: Quick and transparent. Botfather (Telegram) and Slack API Center ◆ Viber: Don’t wait until they apply you, because it may never happen :)
  • 12. Conclusion ➔ We can use PHP and Laravel nevertheless is not that popular among biggest frameworks; ➔ Botman is a decent tool for chatbot development and IMHO preferable with PHP ecosystem; ➔ Look into native API, always! ➔ There are set of nuances specific for each platform, could be solvable or not!
  • 13. Links LaravelUA bot at Facebook: https://www.facebook.com/ualaravelgroup/ and in Messenger: https://www.messenger.com/t/ualaravelgroup Telegram: @laravelua_bot (https://telegram.me/laravelua_bot)