Skip to content

idleup/laravel-twilio

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

laravel-twilio

Laravel Twillio API Integration

Build Status Total Downloads Latest Stable Version Latest Unstable Version License

  • twilio:sms
  • twilio:call

Installation

Begin by installing this package through Composer. Run this command from the Terminal:

    composer require aloha/twilio 1.0.2

Laravel integration

To wire this up in your Laravel project, you need to add the service provider. Open app/config/app.php, and add a new item to the providers array.

'Aloha\Twilio\Support\Laravel\ServiceProvider',

Then, add a Facade for more convenient usage. In app/config/app.php add the following line to the aliases array:

'Twilio' => 'Aloha\Twilio\Facades\Twilio',

Edit services.php in your config folder with your appropriate Twilio settings. Example config can be found in this file.

Facade usage

Sending a SMS Message

<?php

Twilio::message('+18085551212', 'Pink Elephants and Happy Rainbows');

Creating a Call

<?php

Twilio::call('+18085551212', 'http://foo.com/call.xml');

Generating TwiML

<?php

$twiml = Twilio::twiml(function($message) {
    $message->say('Hello');
    $message->play('https://api.twilio.com/cowbell.mp3', array('loop' => 5));
});

print $twiml;

License

laravel-twilio is open-sourced software licensed under the MIT license

About

Laravel 4 & 5 Twillio API Integration

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%