2017 © Pedro Peláez
 

library twiliosms

A Laravel Wrapper for sending SMS messages with Twilio

image

sigfriedseldeslachts/twiliosms

A Laravel Wrapper for sending SMS messages with Twilio

  • Thursday, August 31, 2017
  • by sigfriedseldeslachts
  • Repository
  • 1 Watchers
  • 1 Stars
  • 38 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Laravel Twilio API Wrapper

New update is comming! (Using PHP chaining)

A Laravel 5.3+ wrapper for sending messages or calls with the Twilio API., (*1)

Setting up

You can install the package via composer:, (*2)

composer require sigfriedseldeslachts/twiliosms

Then, add the service provider and the alias, (*3)

// File: config/app.php

'providers' => [
    ...
    Sigfriedseldeslachts\twiliosms\TwilioSMSServiceProvider::class,
    ...
];

'aliases' => [
    ...
    'Twillio' => Sigfriedseldeslachts\twiliosms\Facades\Twilio::class,
    ...
];

After that you'll have to add a few lines to your .env file:, (*4)

TWILIO_SID=Your Twilio SID Token
TWILIO_TOKEN=Yout Twilio Token
TWILIO_NUMBER=Your twilio phone number, without +

And now you're ready to go!, (*5)

Usage

Global note

Removing the '+' from a phone number is not required as the plugin wil remove this automatically., (*6)

Sending a text message (SMS)

Twilio::SMS(string $to, string $message);

If you want to use a different phone number to send the text from:, (*7)

Twilio::SMS(string $to, string $message, string $from);

Example

Twilio::SMS('+123456789', 'Hello from Laravel!', '+987456321');

Sending a text message with image (MMS)

The image url needs to be a jpeg, gif or png file., (*8)

Twilio::MMS(string $to, string $message, string $url);

If you want to use a different phone number to send the text from:, (*9)

Twilio::MMS(string $to, string $message, string $url, string $from);

Example

Twilio::MMS('+123456789', 'Hello from Laravel!', 'http://www.hookinfo.com/wp-content/uploads/2016/08/laravel-1.png', '+987456321');

Making a call

To make a call you need to have a valid TwiML which needs to be a url. See the example below., (*10)

Twilio::Call(string $to, string $url);

If you want to use a different phone number to call from:, (*11)

Twilio::Call(string $to, string $url, string $from);

Example

Twilio::Call('+123456789', 'http://demo.twilio.com/docs/voice.xml', '+987456321');

Contributing

Feel free to help me out ;), (*12)

Security issue

If the security issue is related to the wrapper please contact me with my email: sigfriedseldeslachts@gmail.com, if it's an Twilio API issue please contact them., (*13)

License

MIT License, see license file for more info., (*14)

The Versions

31/08 2017

dev-master

9999999-dev

A Laravel Wrapper for sending SMS messages with Twilio

  Sources   Download

MIT

The Requires

 

by Sigfried Seldeslachts

08/03 2017

dev-dev

dev-dev https://github.com/sigfriedseldeslachts/twiliosms

A Laravel 5.3+ Wrapper for sending messages with Twilio

  Sources   Download

MIT

The Requires

 

by Sigfried Seldeslachts

laravel sms twilio mms call

24/01 2017

0.0.3

0.0.3.0

A Laravel Wrapper for sending SMS messages with Twilio

  Sources   Download

MIT

The Requires

 

by Sigfried Seldeslachts

23/01 2017

0.0.1

0.0.1.0

A Laravel Wrapper for sending SMS messages with Twilio

  Sources   Download

MIT

The Requires

 

by Sigfried Seldeslachts

23/01 2017

0.0.2

0.0.2.0

A Laravel Wrapper for sending SMS messages with Twilio

  Sources   Download

MIT

The Requires

 

by Sigfried Seldeslachts