laravel5-twilio
Laravel 5 Twillio API Integration, (*1)
Installation
Begin by installing this package through Composer. Edit your project's composer.json file to require johnpaulmedina/twilio and the repository (only until we publish on packagist)., (*2)
"require": {
...
"johnpaulmedina/twilio": "2.0.*",
},
"repositories": [
{
"type": "vcs",
"url": "git@github.com:johnpaulmedina/laravel-twilio.git"
}
]
Next, update Composer from the Terminal:, (*3)
composer update
Once composer is finished, you need to add the service provider. Open config/app.php, and add a new item to the providers array., (*4)
'Jp\Twilio\TwilioServiceProvider',
Then, add a Facade for more convenient usage. In config/app.php add the following line to the aliases array:, (*5)
'Twilio' => 'Jp\Twilio\Facades\Twilio',
Add the configuration to config/services.php, (*6)
'twilio' => [
'sid' => 'Your Twilio Account SID #',
'token' => 'Access token that can be found in your Twilio dashboard',
'from' => 'The Phone number registered with Twilio that your SMS & Calls will come from',
'ssl_verify' => true, // Development switch to bypass API SSL certificate verfication
]
Usage
Sending a SMS Message, (*7)
Creating a Call, (*8)
Generating TwiML, (*9)
say('Hello');
$message->play('https://api.twilio.com/cowbell.mp3', array('loop' => 5));
});
print $twiml;
?>
License
laravel5-twilio is open-sourced software licensed under the MIT license, (*10)
Credits
Based on the original Laravel 4 package by Travis J Ryan that can be found here:, (*11)
https://github.com/aloha/laravel4-twilio, (*12)