Skip to content
Laravel implementation of Twilio Chat
Branch: master
Clone or download
jefflinwood Merge pull request #9 from TwilioDevEd/update-chat-js-client
Initialize Twilio Chat Client update
Latest commit c8a1195 Dec 7, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
bootstrap laravel initial commit Jan 20, 2016
config Update Twilio library, use ChatGrant Nov 5, 2018
database
public Initialize Twilio Chat Client update Dec 7, 2018
resources
storage laravel initial commit Jan 20, 2016
tests
.env.example Update Twilio library, use ChatGrant Nov 5, 2018
.gitignore
.travis.yml Update travis.yml PHP version Nov 5, 2018
LICENSE
artisan laravel initial commit Jan 20, 2016
composer.json
composer.lock Update Twilio library, use ChatGrant Nov 5, 2018
gulpfile.js
package.json laravel initial commit Jan 20, 2016
phpunit.xml
readme.md
server.php

readme.md

twiliochat-laravel

Build Status

Laravel implementation of Twilio Chat

Run the application

  1. Clone the repository and cd into it

  2. Install the application's dependencies with Composer

    composer install
  3. Copy the sample configuration file and edit it to match your configuration

    cp .env.example .env

You can find your TWILIO_ACCOUNT_SID in your Twilio Account Settings. You need to create an API key that will give you a TWILIO_API_KEY and a TWILIO_API_SECRET. For that purpose click here.

For TWILIO_CHAT_SERVICE_SID you can click here, where you must create a Programmable Chat Service. When the service is created you'll have access to the service's SID.

  1. Generate an APP_KEY

    php artisan key:generate
  2. Run the application using Artisan

php artisan serve

Now you can access the application at http://localhost:8000.

Expose your localhost to the internet

If you want your chat application to be reachable publicly in the internet, you can use a service like ngrok.

  1. Expose the application to the wider Internet

    ngrok http 8000

It is artisan serve default behavior to use http://localhost:8000 when running the application. This means that the ip addresses where your app will be reachable on you local machine will vary depending on the operating system.

The most common scenario, is that your app will be reachable through address http://127.0.0.1:8000, and this is important because ngrok creates the tunnel using only that address. So, if http://127.0.0.1:8000 is not reachable in your local machine when you run the app, you must tell artisan to use an address, like this:

php artisan serve --host=127.0.0.1

Dependencies

This application uses this Twilio helper library

Run the tests

  1. Run at the top-level directory

    vendor/bin/phpunit

    If you don't have phpunit installed on your system, you can follow these instructions to install it.

  2. Run javascript tests

    cd public && npm install && npm test
You can’t perform that action at this time.