Skip to content
This repository has been archived by the owner on Jan 14, 2022. It is now read-only.

paulandroshchuk/transistor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instalation

For Laravel 5.5

composer require ypl/transistor

Usage

Select a gateway and send an SMS message to recipient via the selected gateway.

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

Extend Transistor adding&using your own gateways.

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

About

Laravel SMS provider

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages