Details benedmunds

Laravel-Twilio

Twilio bundle for Laravel

Setup

Install the bundle

$ php artisan bundle:install twilio

Include it in application/bundles.php

return array('twilio');

Usage

In application/routes.php you can add a simple route to send a text message with

Route::get('/, home', function()
{
    Bundle::start('twilio');

    //twilio account settings
    $account_sid = 'ABC123456789';
    $auth_token  = '123456789';

    $client = new Services_Twilio($account_sid, $auth_token);
    $message = $client->account->sms_messages->create(
        '1112223456', // From a valid Twilio number
        '7062894115', // Text this number
        "Ben Edmunds is Awesome!" //Text body
    );

    echo $message->sid;
});

See the Twilio documentation for API details.

Bundle created by Ben Edmunds.

Installation

You can install this bundle by running the following CLI command:

php artisan bundle:install twilio

Alternatively you can download it directly from GitHub:
http://github.com/benedmunds/Laravel-Twilio

Stats

  • Watchers:
  • Forks:
  • Ratings: 4 likes
  • Installs: 1302