Skip to content

dekts/Twilio-Whatsapp-Laravel

Repository files navigation

Twilio-Whatsapp-Laravel

Programmable SMS Quickstart & Twilio Autopilot

Requirements

  • PHP 7 development environment
  • Global installation of Composer
  • Global installation of ngrok
  • Twilio Account
  • Google Account
  • WhatsApp Account
  • Init Commands

    sudo cp demo_credentials.json credentials.json

    sudo cp .env.example .env

    composer install

    Then update the .env file based on google project and if you have crdentials.json file already then only you have to replace the file in this directory.

    Start ngrok

    We will need our webhook.php file to be accessible through a public URL. To do this we will use ngrok. From your terminal run the command:

    php -S localhost:3000

    On a new terminal window, goto root file of ngrok and run the command:

    ./ngrok http 3000

    Set Up Autopilot Assistant

    From your Twilio account, head over to the Autopilot console and create a new assistant. I’ve named mine my-google-project.

    https://www.twilio.com/console/autopilot/list

    Twilio Sandbox for WhatsApp

    Since we will be using WhatsApp as our Autopilot channel, we need to set up our WhatsApp sandbox. On the left, click channels and select WhatsApp.

    Setup using: https://www.twilio.com/docs/autopilot/channels/whatsapp

    Thanks, and let me know if you have any queries.