While BotMan itself is framework agnostic, BotMan is also available as a bundle with the great Laravel PHP framework. This bundled version is called BotMan Studio and makes your chatbot development experience even better. By providing testing tools, an out of the box web driver implementation and additional tools like an enhanced CLI with driver installation, class generation and configuration support, it speeds up the development significantly.
You can find the BotMan and BotMan Studio documentation at http://botman.io.
- Install the app
composer install
- Serve the app
php artisan serve
- Create your schema by
php artisan mysql:createdb botman_db
- Migrate the tables by
php artisan migrate
- Seed the datas by
php artisan db:seed
- Reset database ( will required to seed again )
php artisan migrate:fresh
Steps: ( Reference: https://botman.io/2.0/driver-facebook-messenger )
- Install Facebook driver ( check the doc )
- Add the following:
- FACEBOOK_TOKEN=your-facebook-page-token
- FACEBOOK_VERIFICATION=your-facebook-verification-token
- FACEBOOK_APP_SECRET=your-facebook-app-secret
- Official guideline here to test out =>
https://developers.facebook.com/docs/messenger-platform/getting-started/quick-start
- To be able to integrate you'll need HTTPs protocol. For this u can use
ngrok
to host your localhost. FACEBOOK_VERIFICATION
is what you added by yourself to verify your connection between facebook and your app. ( you can put anything u want. but when you add the webhook they are needed to be matched. ).- After hosing ur localhost by
ngrok
u should be able to add ur webhook in facebook developer dashboard page.example: {ur https ngrok}/botman
FACEBOOK_TOKEN
is retrieved bytoken generation
after adding your webhook in Messenger product (located in develop facebook dashboard sidebar)FACEBOOK_APP_SECRET
is retrieved byDashboard => Setting => Basic
.- Test your connection out with postman. `E.g: https://{your ngrok or your site }/botman?hub.verify_token={your manual token in env}&hub.challenge=CHALLENGE_ACCEPTED&hub.mode=subscribe
- Restart your app once you successfully connected to the facebook.