firmantr3/laravel-sms

Third-party HTTP SMS Gateway library for Laravel. Support zenziva, nusasms, smsgateway[dot]me

1.0.3 2019-10-11 23:49 UTC

This package is auto-updated.

Last update: 2024-04-12 09:40:07 UTC


README

Third-party HTTP SMS Gateway library for Laravel. It supports zenziva, nusasms, smsgateway[dot]me by default. But you can extend it by just updating the config file.

Installation

composer require firmantr3/laravel-sms

Configuration

Register Service Provider (Laravel <= 5.4)

Add to your

<?php
return [
    'providers': [
        // Other Providers above
        Firmantr3\Sms\SmsServiceProvider::class,
    ],
];

Publish Config

php artisan vendor:publish --provider=Firmantr3\\Sms\\SmsServiceProvider

Update Config

Update your preferences in config/sms.php.

Usage

Sending Sms

<?php

use Firmantr3\Sms\Facade\Sms;

// send using default sms channel
Sms::text('test')->phone('081138702880')->send();

// send using particular sms channel
$sms = Sms::channel('zenziva')->text('test text zenziva')->phone('081138702880');
$sms->send();

// debug response data
print_r($sms->getResponse());

Test

vendor/bin/phpunit