2017 © Pedro Peláez
 

library laravel-twilio-sms

Twilio SMS driver for Laravel Notifications

image

koomai/laravel-twilio-sms

Twilio SMS driver for Laravel Notifications

  • Wednesday, August 10, 2016
  • by koomai
  • Repository
  • 1 Watchers
  • 0 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 13 % Grown

The README.md

Twilio Channel for Laravel Notifications

Twilio driver for sending SMS with Laravel Notifications., (*1)

This is pretty much a port of Laravel's default SMS driver., (*2)

Getting Started

  1. Install with composer - composer require koomai/laravel-twilio-sms. This also installs the aloha/twilio package., (*3)

  2. Add 'Aloha\Twilio\Support\Laravel\ServiceProvider'::class to config/app.php, (*4)

  3. Publish the config file php artisan vendor:publish, (*5)

  4. Go to config/twilio.php and add your Twilio credentials plus the number you're sending from. Hint: Use the .env file., (*6)

Usage

Follow Laravel's documentation to add the channel to the via method and create a representation of the notification., (*7)

/**
 * Get the notification's delivery channels.
 *
 * @param  mixed  $notifiable
 * @return array
 */
public function via($notifiable)
{
    return [TwilioSmsChannel::class];
}

/**
 * Get the SMS representation of the notification.
 *
 * @param  mixed  $notifiable
 * @return TwilioMessage
 */
public function toTwilio($notifiable)
{
    return (new TwilioMessage)
                    ->content('This is a test SMS via Plivo using Laravel Notifications!');
                    // ->from('+61455222900'); Chain this method to override default 'from' number
}

The Versions

10/08 2016

dev-master

9999999-dev

Twilio SMS driver for Laravel Notifications

  Sources   Download

MIT

The Requires

 

laravel sms twilio notifications