定制 innoflash/za-sms 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

innoflash/za-sms

Composer 安装命令:

composer require innoflash/za-sms

包简介

An SMS package to handle SMS sending from South African providers

README 文档

README

Software License Travis Total Downloads

Table of contents

Introduction

This package is aimed at creating a South African SMS package for for local SMS providers using their REST APIs. Below is a list of providers we currently integrated:

Install

composer require innoflash/za-sms

Usage

Once the package is installed you will need to set the provider in the .ENV file as follows:

ZA_SMS_PROVIDER={provider}

Available providers:

Use as a notification

za-sms supports being a driver for Laravel Notification

  • In the Notifiable class set your model phone number field by overriding this
    function routeNotificationForZasms($notification)
    {
        return $this->phone_number;
    }
  • In the Notification class use the za-sms as follows
    public function via($notifiable)
    {
        return [ZaSMSChannel::class];
    }
  • Then create the notification body as follows
    function toZaSMS($notifiable)
    {
        return (new ZaSMS)
            ->message('This is my message')  
            ->sendAt(now()->addDays(2)) // for scheduling messegaes 
            ->campaign('my campain'); //for message campaining
    }

Use as a Facade

At times you would want to send the SMS your own way so you can use the ZaSMS facade

    ZaSMS::setRecipientNumber('0651562779')
        ->setMessage('the facade message')
        ->sendMessage();

    //or

    ZaSMS::setMessageData([
        'recipientNumber' => '0027651562779',
        'message' => 'data message'
        ])->sendMessage();

Additionally

You can also access the SMS Provider object using all available service container methods

    $provider = app()->make('za-sms');
    $provider = app()->make(SMSProviderContract::class);

    $provider = resolve('za-sms');
    $provider = resolve(SMSProviderContract::class);

    //or use dependency injection

    function myFunction(SMSProviderContract $provider){
        //todo use the provider
    }

Contributing

Security

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

License

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

统计信息

  • 总下载量: 69
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-01-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固