2017 © Pedro Peláez
 

library transistor

image

ypl/transistor

  • Friday, June 29, 2018
  • by ypl
  • Repository
  • 1 Watchers
  • 1 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Instalation

For Laravel 5.5, (*1)

composer require ypl/transistor

Usage

Select a gateway and send an SMS message to recipient via the selected gateway., (*2)

Transistor::from('twilio', '+10000000000')->send('+10000000000', 'Test Message');

Extend Transistor adding&using your own gateways., (*3)

class AppServiceProvider extends ServiceProvider
{
    public function boot()
    {
        // Register a gateway
        Transistor::extend('nexmo', function (string $senderNumber) {
            return new NexmoGateway($this->app['config']->get('transistor.gateways.nexmo'), $senderNumber);
        });
    }
}

// Use the gateway
Transistor::from('nexmo', '+10000000000')->...

Coming Soon:

  • Testing Compatibility
Transistor::fake();

// Sending stuff

Transistor::assertSent('twilio', '+10000000000')->withMessage('bla bla');
  • Bulk Send
$recipients = [
    '+10000000001',
    '+10000000002' => 'Unique Text',
    '+10000000003',
];

$responses = Transistor::from('twilio', '+10000000000')->send($recipients, 'Bulk Test Message');

$responses->each(function (TwilioResponse $response) {
    //
});

$responses->whereNumber('+10000000001')->getMessageBody(); // Bulk Test Message
$responses->whereNumber('+10000000002')->getMessageBody(); // Unique Text

The Versions

29/06 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires