定制 zanozik/semysms 二次开发

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

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

zanozik/semysms

Composer 安装命令:

composer require zanozik/semysms

包简介

SemySMS Notifications Channel for Laravel

README 文档

README

Latest Version on Packagist Software License

Installation

You can install the package via composer:

composer require zanozik/semysms

You must install the service provider:

// config/app.php
'providers' => [
    ...
    NotificationChannels\SemySMS\SemySMSServiceProvider::class,
],

Setting up the SemySMS service

Sign up on SemySMS and create your token in your Control Panel -> API.

Add the following section and fill in the details there (you can also use your .env file to store your credentials):

// config/services.php
...
'semysms' => [
    'token' => env('SEMYSMS_TOKEN', '12345678901234567890'),
    'device' => env('SEMYSMS_DEVICE', '12345')
],
...

Usage

You can now use the channel in your via() method inside the Notification class.

use NotificationChannels\SemySMS\SemySMSChannel;
use NotificationChannels\SemySMS\SemySMSMessage;
use Illuminate\Notifications\Notification;

class InvoicePaid extends Notification{

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

    public function toSmsGatewayMe($notifiable){
        return (new SemySMSMessage)->text('Your invoice has been paid');
    }
}

Routing a message

You should add a routeNotificationForSemySMS() method in your notifiable model:

...
/**
 * Route notifications for the SemySMS channel.
 *
 * @return int
 */
public function routeNotificationForSemySMS(){
    return $this->phone_number;
}
...

Available methods

  • text($text): (string) SMS Text.

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固