- simple wrapper for sending sms messages via twilio with Laravel4.
- calls or anything else other than sending sms messages is not currently supported (pull requests welcome)
-
add the following to your composer
require
:"twilio/laratwilio": "dev-master"
-
run from terminal:
composer update
-
add Laratwilio to the list of providers. In
config/app.php
add the following line to theproviders
array:'Twilio\Laratwilio\LaratwilioServiceProvider'
-
add a Facade for more convenient usage. In
config/app.php
add the following line to thealiases
array:'Sms' => 'Twilio\Laratwilio\Facades\Laratwilio'
-
publish config files so that you can put your Twilio details in the right place. In your terminal:
php artisan config:publish twilio/laratwilio
-
edit the new config file in the
config/packages/twilio/laratwilio
and enter your data
Anywhere in your application when you need to send an sms message, just do:
Sms::send(array('to'=>'+12345678', 'text'=>'hello world'));