hsmfawaz/enjaz-sms

Enjaz Sms service provider wrapper with notification channel support

dev-master 2020-12-10 17:06 UTC

This package is auto-updated.

Last update: 2024-04-11 00:38:15 UTC


README

Software License Travis Total Downloads

Install

composer require hsmfawaz/enjaz-sms

Configuration

Follow the following instructions to install the package successfully

.env

ENJAZ_USERNAME='XXX'
ENJAZ_PASSWORD='XXX'
ENJAZ_SENDER='XXX'

if you want to publish the config

php artisan vendor:publish --provider="HsmFawaz\EnjazSms\EnjazSmsServiceProvider" 
--tag="config"

Usage

You can use the class to send directly

use \Hsmfawaz\EnjazSms\EnjazSms;

$client = new EnjazSms();
$result = $client->to(['+9665XXXXXXX','9665XXXXXXX'])->send('Your message here');
//you will get array from parsed request body

or you can use the channel for notifications support

//Example app/Notifications/RecoveryCodeNotification.php
use \Hsmfawaz\EnjazSms\EnjazSmsChannel;

public function via($notifiable)
    {
        return [EnjazSmsChannel::class];
    }

public function toEnjazSms($notifiable)
    {
        return [
            'phone' => 'phone number',
            'body' =>'message',
        ];
    }

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email hsm.fawaz@gmail.com instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.