Laravel5-twilio
, (*1)
Installation
Begin by installing this package through Composer. Run this command from the Terminal:, (*2)
composer require parfumix/laravel5-twilio
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., (*3)
'Twilio\Laravel5TwilioServiceProvider',
Then, add a Facade for more convenient usage. In app/config/app.php
add the following line to the aliases
array:, (*4)
'Twilio' => 'Twilio\Facades\Twilio',
To add new connections just publish your config file using command and go to your config folder., (*5)
php artisan vendor:publish
Dont't forget to import facades to controllers.
Sending a SMS Message, (*6)
<?php
Use Twilio;
Twilio::sms('+18085551212', 'Message text');
Creating a Call, (*7)
<?php
Use Twilio;
Twilio::call('+18085551212', 'http://foo.com/call.xml');
License
laravel-twilio is open-sourced software licensed under the MIT license, (*8)