taiwan-sms/mitake 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

taiwan-sms/mitake

Composer 安装命令:

composer require taiwan-sms/mitake

包简介

三竹簡訊 mitake api client

README 文档

README

StyleCI Build Status Total Downloads Latest Stable Version Latest Unstable Version License Monthly Downloads Daily Downloads Scrutinizer Code Quality Code Coverage

This package makes it easy to send notifications using [mitake] with Laravel 5.3+.

Contents

Installation

You can install the package via composer:

composer require taiwan-sms/mitake illuminate/notifications php-http/guzzle6-adapter

Then you must install the service provider:

// config/app.php
'providers' => [
    ...
    TaiwanSms\Mitake\MitakeServiceProvider::class,
],

Setting up the Mitake service

Add your Mitake login, secret key (hashed password) and default sender name (or phone number) to your config/services.php:

// config/services.php
...
'mitake' => [
    'username' => env('SERVICES_MITAKE_USERNAME'),
    'password' => env('SERVICES_MITAKE_PASSWORD'),
],
...

Usage

You can use the channel in your via() method inside the notification:

use TaiwanSms\Mitake\MitakeMessage;
use TaiwanSms\Mitake\MitakeChannel;
use Illuminate\Notifications\Notification;

class AccountApproved extends Notification
{
    public function via($notifiable)
    {
        return [MitakeChannel::class];
    }

    public function toMitake($notifiable)
    {
        return MitakeMessage::create("Task #{$notifiable->id} is complete!");
    }
}

In your notifiable model, make sure to include a routeNotificationForTwSMS() method, which return the phone number.

public function routeNotificationForTwSMS()
{
    return $this->phone;
}

Available methods

subject(): Sets a subject of the notification subject.

content(): Sets a content of the notification message.

sendTime(): Set send time of the notification message.

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Security

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

Contributing

Please see CONTRIBUTING for details.

Credits

License

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

API Only

composer require taiwan-sms/mitake php-http/guzzle6-adapter

How to use

require __DIR__.'/vendor/autoload.php';

use TaiwanSms\Mitake\Client;

$userId = 'xxx';
$password = 'xxx';

$client = new Client($userId, $password);

var_dump($client->credit()); // 取得額度
var_dump($client->send([
    'to' => '09xxxxxxxx',
    'text' => 'test message',
]));
/*
return [
    'msgid' => '0892448417',
    'statuscode' => '1',
    'AccountPoint' => '97',
];
*/

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-12-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固